@ -17,8 +17,10 @@ import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation ;
import io.swagger.annotations.ApiOperationSort ;
import io.swagger.annotations.ApiParam ;
import java.util.List ;
import javax.validation.constraints.NotNull ;
import lombok.extern.slf4j.Slf4j ;
import org.springframework.beans.factory.annotation.Autowired ;
import org.springframework.web.bind.annotation.CrossOrigin ;
@ -45,227 +47,250 @@ import org.springframework.web.bind.annotation.RestController;
@Api ( tags = "积分模块" )
public class PointController {
@Autowired
private TaskPointService taskPointService ;
@Autowired
private TaskPointService taskPointService ;
@Autowired
private UserPointLogService userPointLogService ;
@Autowired
private LotteryService lotteryService ;
@Autowired
private UserPointLogService userPointLogService ;
@Autowired
private LotteryService lotteryService ;
@ApiOperation ( value = "1.1.新增任务积分配置" , notes = "仅限admin权限用户调用" )
@PostMapping ( "/task/add" )
@GlobalInterceptor ( checkAdminLogin = true )
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "taskPoint" , value = "任务积分配置" , required = true , dataType = "TaskPoint" , paramType = "body" ) ,
@ApiImplicitParam ( name = "Authorization" , value = "token" , required = true , dataType = "String" , paramType = "header" ) } )
public Result < Void > add (
@RequestHeader ( value = "Authorization" , required = true ) String authorization ,
@RequestBody TaskPoint taskPoint ) {
taskPointService . add ( taskPoint , authorization ) ;
return Result . success ( ) ;
}
@ApiOperation ( value = "1.2.修改任务积分配置" , notes = "仅限admin权限用户调用" )
@PostMapping ( "/task/update" )
@GlobalInterceptor ( checkAdminLogin = true )
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "taskPoint" , value = "任务积分配置" , required = true , dataType = "TaskPoint" , paramType = "body" ) ,
@ApiImplicitParam ( name = "Authorization" , value = "token" , required = true , dataType = "String" , paramType = "header" ) }
)
public Result < Void > update (
@RequestHeader ( value = "Authorization" , required = true ) String authorization ,
@RequestBody TaskPoint taskPoint ) {
taskPointService . update ( taskPoint , authorization ) ;
return Result . success ( ) ;
}
@ApiOperation ( value = "1.1.新增任务积分配置" , notes = "仅限admin权限用户调用" )
@PostMapping ( "/task/add" )
@GlobalInterceptor ( checkAdminLogin = true )
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "taskPoint" , value = "任务积分配置" , required = true , dataType = "TaskPoint" , paramType = "body" ) ,
@ApiImplicitParam ( name = "Authorization" , value = "token" , required = true , dataType = "String" , paramType = "header" ) } )
public Result < Void > add (
@RequestHeader ( value = "Authorization" , required = true ) String authorization ,
@RequestBody TaskPoint taskPoint ) {
taskPointService . add ( taskPoint , authorization ) ;
return Result . success ( ) ;
}
@ApiOperation ( value = "1.3.批量修改任务积分配置" , notes = "仅限admin权限用户调用" )
@PostMapping ( "/task/batch/update" )
@GlobalInterceptor ( checkAdminLogin = true )
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "taskPoints" , value = "任务积分配置" , required = true , dataType = "List<TaskPoint>" , paramType = "body" ) ,
@ApiImplicitParam ( name = "Authorization" , value = "token" , required = true , dataType = "String" , paramType = "header" ) }
)
public Result < Void > batchUpdate (
@RequestHeader ( value = "Authorization" , required = true ) String authorization ,
@RequestBody List < TaskPoint > taskPoints ) {
taskPointService . batchUpdate ( taskPoints , authorization ) ;
return Result . success ( ) ;
}
@ApiOperation ( value = "1.2.修改任务积分配置" , notes = "仅限admin权限用户调用" )
@PostMapping ( "/task/update" )
@GlobalInterceptor ( checkAdminLogin = true )
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "taskPoint" , value = "任务积分配置" , required = true , dataType = "TaskPoint" , paramType = "body" ) ,
@ApiImplicitParam ( name = "Authorization" , value = "token" , required = true , dataType = "String" , paramType = "header" ) }
)
public Result < Void > update (
@RequestHeader ( value = "Authorization" , required = true ) String authorization ,
@RequestBody TaskPoint taskPoint ) {
taskPointService . update ( taskPoint , authorization ) ;
return Result . success ( ) ;
}
@ApiOperation ( value = "1.4.批量禁用任务积分配置" , notes = "仅限admin权限用户调用" )
@PostMapping ( "/task/batch/disable" )
@GlobalInterceptor ( checkAdminLogin = true )
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "ids" , value = "任务积分配置id" , required = true , dataType = "List<String>" , paramType = "body" ) ,
@ApiImplicitParam ( name = "Authorization" , value = "token" , required = true , dataType = "String" , paramType = "header" ) ,
@ApiImplicitParam ( name = "valid" , value = "是否生效 1-生效 2-不生效" , required = true , dataType = "Integer" , paramType = "query" )
}
)
public Result < Void > batchDisable (
@RequestHeader ( value = "Authorization" , required = true ) String authorization ,
@RequestBody List < String > ids ,
@RequestParam Integer valid ) {
taskPointService . batchDisable ( ids , authorization , valid ) ;
return Result . success ( ) ;
}
@ApiOperation ( value = "1.3.批量修改任务积分配置" , notes = "仅限admin权限用户调用" )
@PostMapping ( "/task/batch/update" )
@GlobalInterceptor ( checkAdminLogin = true )
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "taskPoints" , value = "任务积分配置" , required = true , dataType = "List<TaskPoint>" , paramType = "body" ) ,
@ApiImplicitParam ( name = "Authorization" , value = "token" , required = true , dataType = "String" , paramType = "header" ) }
)
public Result < Void > batchUpdate (
@RequestHeader ( value = "Authorization" , required = true ) String authorization ,
@RequestBody List < TaskPoint > taskPoints ) {
taskPointService . batchUpdate ( taskPoints , authorization ) ;
return Result . success ( ) ;
}
@ApiOperation ( value = "1.5.禁用任务积分配置" , notes = "仅限admin权限用户调用" )
@PostMapping ( "/task/disable" )
@GlobalInterceptor ( checkAdminLogin = true )
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "id" , value = "任务积分配置id" , required = true , dataType = "String" , paramType = "body" ) ,
@ApiImplicitParam ( name = "Authorization" , value = "token" , required = true , dataType = "String" , paramType = "header" ) ,
@ApiImplicitParam ( name = "valid" , value = "是否生效 1-生效 2-不生效" , required = true , dataType = "Integer" , paramType = "query" )
} )
public Result < Void > disable (
@RequestHeader ( value = "Authorization" , required = true ) String authorization ,
@RequestParam String id ,
@RequestParam Integer valid ) {
taskPointService . disable ( id , authorization , valid ) ;
return Result . success ( ) ;
}
@ApiOperation ( value = "1.4.批量禁用任务积分配置" , notes = "仅限admin权限用户调用" )
@PostMapping ( "/task/batch/disable" )
@GlobalInterceptor ( checkAdminLogin = true )
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "ids" , value = "任务积分配置id" , required = true , dataType = "List<String>" , paramType = "body" ) ,
@ApiImplicitParam ( name = "Authorization" , value = "token" , required = true , dataType = "String" , paramType = "header" ) ,
@ApiImplicitParam ( name = "valid" , value = "是否生效 1-生效 2-不生效" , required = true , dataType = "Integer" , paramType = "query" )
}
)
public Result < Void > batchDisable (
@RequestHeader ( value = "Authorization" , required = true ) String authorization ,
@RequestBody List < String > ids ,
@RequestParam Integer valid ) {
taskPointService . batchDisable ( ids , authorization , valid ) ;
return Result . success ( ) ;
}
@ApiOperation ( value = "1.6. 任务积分列表" , notes = "任务积分列表" )
@GetMapping ( "/task/list/{page}/{size}" )
public Result < PageResult < TaskPoint > > getUnApproveList (
@ApiParam ( value = "Header中的token信息" , required = true ) @RequestHeader ( "Authorization" ) String token ,
@ApiParam ( value = "页码" , required = true ) @PathVariable Integer page ,
@ApiParam ( value = "每页条数" , required = true ) @PathVariable Integer size ) {
return Result . success ( taskPointService . getTaskPointList ( page , size ) ) ;
}
@ApiOperation ( value = "1.5.禁用任务积分配置" , notes = "仅限admin权限用户调用" )
@PostMapping ( "/task/disable" )
@GlobalInterceptor ( checkAdminLogin = true )
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "id" , value = "任务积分配置id" , required = true , dataType = "String" , paramType = "body" ) ,
@ApiImplicitParam ( name = "Authorization" , value = "token" , required = true , dataType = "String" , paramType = "header" ) ,
@ApiImplicitParam ( name = "valid" , value = "是否生效 1-生效 2-不生效" , required = true , dataType = "Integer" , paramType = "query" )
} )
public Result < Void > disable (
@RequestHeader ( value = "Authorization" , required = true ) String authorization ,
@RequestParam String id ,
@RequestParam Integer valid ) {
taskPointService . disable ( id , authorization , valid ) ;
return Result . success ( ) ;
}
@ApiOperation ( value = "2.1. 用户根据新手任务获取积分" , notes = "仅限app用户调用" )
@PostMapping ( "/log/earn/task/new" )
@GlobalInterceptor ( checkAppUserLogin = true )
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "Authorization" , value = "token" , required = true , dataType = "String" , paramType = "header" ) ,
@ApiImplicitParam ( name = "taskPointId" , value = "任务积分配置id" , required = true , dataType = "String" , paramType = "body" )
} )
public Result < Void > addLogNew (
@RequestHeader ( value = "Authorization" , required = true ) String authorization ,
@RequestBody String taskPointId ) {
userPointLogService . addByTaskNew ( taskPointId , authorization ) ;
return Result . success ( ) ;
}
@ApiOperation ( value = "1.6. 任务积分列表" , notes = "任务积分列表" )
@GetMapping ( "/task/list/{page}/{size}" )
public Result < PageResult < TaskPoint > > getUnApproveList (
@ApiParam ( value = "Header中的token信息" , required = true ) @RequestHeader ( "Authorization" ) String token ,
@ApiParam ( value = "页码" , required = true ) @PathVariable Integer page ,
@ApiParam ( value = "每页条数" , required = true ) @PathVariable Integer size ) {
return Result . success ( taskPointService . getTaskPointList ( page , size ) ) ;
}
@ApiOperation ( value = "2.2. 用户根据日常任务获取积分" , notes = "仅限app用户调用" )
@PostMapping ( "/log/earn/task/daily" )
@GlobalInterceptor ( checkAppUserLogin = true )
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "Authorization" , value = "token" , required = true , dataType = "String" , paramType = "header" ) ,
@ApiImplicitParam ( name = "taskPointId" , value = "任务积分配置id" , required = true , dataType = "String" , paramType = "body" )
} )
public Result < Void > addLogDaily (
@RequestHeader ( value = "Authorization" , required = true ) String authorization ,
@RequestBody String taskPointId ) {
userPointLogService . addByTaskDaily ( taskPointId , authorization ) ;
return Result . success ( ) ;
}
@ApiOperation ( value = "2.1. 用户根据新手任务获取积分" , notes = "仅限app用户调用" )
@PostMapping ( "/log/earn/task/new" )
@GlobalInterceptor ( checkAppUserLogin = true )
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "Authorization" , value = "token" , required = true , dataType = "String" , paramType = "header" ) ,
@ApiImplicitParam ( name = "taskPointId" , value = "任务积分配置id" , required = true , dataType = "String" , paramType = "body" )
} )
public Result < Void > addLogNew (
@RequestHeader ( value = "Authorization" , required = true ) String authorization ,
@RequestBody String taskPointId ) {
userPointLogService . addByTaskNew ( taskPointId , authorization ) ;
return Result . success ( ) ;
}
@ApiOperation ( value = "2.3.用户积分日志列表" , notes = "用户积分日志列表" )
@PostMapping ( "/log/list/{page}/{size}" )
@GlobalInterceptor ( checkAppUserLogin = true )
public Result < PageResult < UserPointLog > > getUserPointLogList (
@ApiParam ( value = "Header中的token信息" , required = true ) @RequestHeader ( "Authorization" ) String token ,
@ApiParam ( value = "查询对象" ) @RequestBody UserPointLogSearchDto userPointLogSearchDto ,
@ApiParam ( value = "页码" , required = true ) @PathVariable Integer page ,
@ApiParam ( value = "每页条数" , required = true ) @PathVariable Integer size ) {
return Result . success (
userPointLogService . getUserPointLogList ( token , userPointLogSearchDto , page , size ) ) ;
}
@ApiOperation ( value = "2.2. 用户根据日常任务获取积分" , notes = "仅限app用户调用" )
@PostMapping ( "/log/earn/task/daily" )
@GlobalInterceptor ( checkAppUserLogin = true )
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "Authorization" , value = "token" , required = true , dataType = "String" , paramType = "header" ) ,
@ApiImplicitParam ( name = "taskPointId" , value = "任务积分配置id" , required = true , dataType = "String" , paramType = "body" )
} )
public Result < Void > addLogDaily (
@RequestHeader ( value = "Authorization" , required = true ) String authorization ,
@RequestBody String taskPointId ) {
userPointLogService . addByTaskDaily ( taskPointId , authorization ) ;
return Result . success ( ) ;
}
@ApiOperation ( value = "2.4.每日签到" , notes = "仅限app用户调用" )
@PostMapping ( "/log/earn/sign" )
@GlobalInterceptor ( checkAppUserLogin = true )
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "Authorization" , value = "token" , required = true , dataType = "String" , paramType = "header" )
} )
public Result < Void > addLogSign ( @RequestHeader ( value = "Authorization" , required = true ) String authorization ) {
userPointLogService . dailySign ( authorization ) ;
return Result . success ( ) ;
}
@ApiOperation ( value = "2. 3.用户积分日志列表", notes = "用户积分日志列表 ")
@PostMapping ( "/log/list/{page}/{size} ")
@GlobalInterceptor ( checkAppUserLogin = true )
public Result < PageResult < UserPointLog > > getUserPointLogList (
@Api Param( value = " Header中的 token信息 ", required = true ) @RequestHeader ( "Authorization" ) String token ,
@ApiParam ( value = "查询对象" ) @RequestBody UserPointLogSearchDto userPointLogSearchDto ,
@ApiParam ( value = "页码" , required = true ) @PathVariable Integer page ,
@ApiParam ( value = "每页条数" , required = true ) @PathVariable Integer size ) {
return Result . success (
userPointLogService . getUserPointLogList ( token , userPointLogSearchDto , page , size ) ) ;
}
@ApiOperation ( value = "2.5.分享期刊" , notes = "仅限app用户调用" )
@PostMapping ( "/log/share/journal" )
@GlobalInterceptor ( checkAppUserLogin = true )
@ApiImplicitParams ( {
@Api Implicit Param( name = "Authorization" , value = " token", required = true , dataType = "String" , paramType = "header" ) ,
@ApiImplicitParam ( name = "journalId" , value = "期刊id" , required = true , dataType = "String" , paramType = "query" )
} )
public Result < Void > addLogShareJournal ( @RequestHeader ( value = "Authorization" , required = true ) String authorization , @RequestParam String journalId ) {
userPointLogService . shareJournal ( authorization ) ;
return Result . success ( ) ;
}
@ApiOperation ( value = "3.1.添加抽奖" , notes = "仅限admin权限用户调用" )
@PostMapping ( "/lottery/add" )
@GlobalInterceptor ( checkAdminLogin = true )
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "Authorization" , value = "token" , required = true , dataType = "String" , paramType = "header" ) ,
@ApiImplicitParam ( name = "lottery" , value = "抽奖信息" , required = true , dataType = "Lottery" , paramType = "body" )
} )
public Result < Void > addLottery ( @RequestHeader ( "Authorization" ) String token ,
@RequestBody Lottery lottery ) {
lotteryService . add ( lottery , token ) ;
return Result . success ( ) ;
}
@ApiOperation ( value = "3.2.抽奖列表页" , notes = "仅限admin权限用户调用" )
@PostMapping ( "/lottery/list/{page}/{size}" )
@GlobalInterceptor ( checkAdminLogin = true )
public Result < PageResult < Lottery > > lotteryList (
@ApiParam ( value = "Header中的token信息" , required = true ) @RequestHeader ( "Authorization" ) String token ,
@ApiParam ( value = "查询对象" ) @RequestBody LotterySearchDto lotterySearchDto ,
@ApiParam ( value = "页码" , required = true ) @PathVariable Integer page ,
@ApiParam ( value = "每页条数" , required = true ) @PathVariable Integer size ) {
return Result . success ( lotteryService . lotteryPageResult ( page , size , lotterySearchDto ) ) ;
}
@ApiOperation ( value = "3.1.添加抽奖" , notes = "仅限admin权限用户调用" )
@PostMapping ( "/lottery/add" )
@GlobalInterceptor ( checkAdminLogin = true )
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "Authorization" , value = "token" , required = true , dataType = "String" , paramType = "header" ) ,
@ApiImplicitParam ( name = "lottery" , value = "抽奖信息" , required = true , dataType = "Lottery" , paramType = "body" )
} )
public Result < Void > addLottery ( @RequestHeader ( "Authorization" ) String token ,
@RequestBody Lottery lottery ) {
lotteryService . add ( lottery , token ) ;
return Result . success ( ) ;
}
@ApiOperation ( value = "3.3.编辑抽奖" , notes = "仅限admin权限用户调用" )
@PostMapping ( "/lottery/edit" )
@GlobalInterceptor ( checkAdminLogin = true )
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "Authorization" , value = "token" , required = true , dataType = "String" , paramType = "header" ) ,
@ApiImplicitParam ( name = "lottery" , value = "抽奖信息" , required = true , dataType = "Lottery" , paramType = "body" )
} )
public Result < Void > editLottery ( @RequestHeader ( "Authorization" ) String token ,
@RequestBody Lottery lottery ) {
lotteryService . edit ( lottery , token ) ;
return Result . success ( ) ;
}
@ApiOperation ( value = "3.2.抽奖列表页" , notes = "仅限admin权限用户调用" )
@PostMapping ( "/lottery/list/{page}/{size}" )
@GlobalInterceptor ( checkAdminLogin = true )
public Result < PageResult < Lottery > > lotteryList (
@ApiParam ( value = "Header中的token信息" , required = true ) @RequestHeader ( "Authorization" ) String token ,
@ApiParam ( value = "查询对象" ) @RequestBody LotterySearchDto lotterySearchDto ,
@ApiParam ( value = "页码" , required = true ) @PathVariable Integer page ,
@ApiParam ( value = "每页条数" , required = true ) @PathVariable Integer size ) {
return Result . success ( lotteryService . lotteryPageResult ( page , size , lotterySearchDto ) ) ;
}
@ApiOperation ( value = "3. 4.发布 抽奖", notes = "仅限admin权限用户调用" )
@PostMapping ( "/lottery/publish ")
@GlobalInterceptor ( checkAdminLogin = true )
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "Authorization" , value = "token" , required = true , dataType = "String" , paramType = "header" ) ,
@ApiImplicitParam ( name = " id", value = "抽奖id ", required = true , dataType = " String ", paramType = "body" )
} )
public Result < Void > publish Lottery( @RequestHeader ( "Authorization" ) String token ,
@RequestBody String id ) {
lotteryService . publish ( id , token ) ;
return Result . success ( ) ;
}
@ApiOperation ( value = "3.3.编辑抽奖" , notes = "仅限admin权限用户调用" )
@PostMapping ( "/lottery/edit ")
@GlobalInterceptor ( checkAdminLogin = true )
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "Authorization" , value = "token" , required = true , dataType = "String" , paramType = "header" ) ,
@ApiImplicitParam ( name = " lottery", value = "抽奖信息 ", required = true , dataType = " Lottery ", paramType = "body" )
} )
public Result < Void > edit Lottery( @RequestHeader ( "Authorization" ) String token ,
@RequestBody Lottery lottery ) {
lotteryService . edit ( lottery , token ) ;
return Result . success ( ) ;
}
@ApiOperation ( value = "3.5.停止抽奖" , notes = "仅限admin权限用户调用" )
@PostMapping ( "/lottery/stop" )
@GlobalInterceptor ( checkAdminLogin = true )
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "Authorization" , value = "token" , required = true , dataType = "String" , paramType = "header" ) ,
@ApiImplicitParam ( name = "id" , value = "抽奖id" , required = true , dataType = "String" , paramType = "query" ) ,
@ApiImplicitParam ( name = "stopReason" , value = "停止原因" , required = true , dataType = "String" , paramType = "body" )
} )
public Result < Void > stopLottery ( @RequestHeader ( "Authorization" ) String token ,
@NotNull String id , @RequestBody @NotNull String stopReason ) {
lotteryService . stop ( id , token , stopReason ) ;
return Result . success ( ) ;
}
@ApiOperation ( value = "3.4.发布抽奖" , notes = "仅限admin权限用户调用" )
@PostMapping ( "/lottery/publish" )
@GlobalInterceptor ( checkAdminLogin = true )
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "Authorization" , value = "token" , required = true , dataType = "String" , paramType = "header" ) ,
@ApiImplicitParam ( name = "id" , value = "抽奖id" , required = true , dataType = "String" , paramType = "body" )
} )
public Result < Void > publishLottery ( @RequestHeader ( "Authorization" ) String token ,
@RequestBody String id ) {
lotteryService . publish ( id , token ) ;
return Result . success ( ) ;
}
@ApiOperation ( value = "3.6.参与抽奖" )
@PostMapping ( "/lottery/participate" )
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "Authorization" , value = "token" , required = true , dataType = "String" , paramType = "header" ) ,
@ApiImplicitParam ( name = "id" , value = "抽奖id" , required = true , dataType = "String" , paramType = "query" ) ,
@ApiImplicitParam ( name = "regionId" , value = "区域id" , required = true , dataType = "String" , paramType = "query" )
} )
public Result < Void > participate ( @RequestHeader ( "Authorization" ) String token , @NotNull String id , @NotNull Integer regionId ) {
lotteryService . participate ( id , token , regionId ) ;
return Result . success ( ) ;
}
@ApiOperation ( value = "3.5.停止抽奖" , notes = "仅限admin权限用户调用" )
@PostMapping ( "/lottery/stop" )
@GlobalInterceptor ( checkAdminLogin = true )
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "Authorization" , value = "token" , required = true , dataType = "String" , paramType = "header" ) ,
@ApiImplicitParam ( name = "id" , value = "抽奖id" , required = true , dataType = "String" , paramType = "query" ) ,
@ApiImplicitParam ( name = "stopReason" , value = "停止原因" , required = true , dataType = "String" , paramType = "body" )
} )
public Result < Void > stopLottery ( @RequestHeader ( "Authorization" ) String token ,
@NotNull String id , @RequestBody @NotNull String stopReason ) {
lotteryService . stop ( id , token , stopReason ) ;
return Result . success ( ) ;
}
@ApiOperation ( value = "3.7.自动抽奖结果" , notes = "用这个方法主动触发自动抽奖结果" )
@PostMapping ( "/lottery/auto ")
@GlobalInterceptor ( checkAdminLogin = true )
@ApiImplicitParams ( {
@ApiImplicitParam ( name = " Authorization", value = "token ", required = true , dataType = "String" , paramType = " header ") ,
@ApiImplicitParam ( name = " id", value = " 抽奖 id", required = true , dataType = "String" , paramType = "query" )
} )
public Result < Void > auto ( @RequestHeader ( "Authorization" ) String token , @NotNull String i d) {
lotteryService . auto ( id , token ) ;
return Result . success ( ) ;
}
@ApiOperation ( value = "3. 6.参与抽奖 ")
@PostMapping ( "/lottery/participate ")
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "Authorization" , value = "token" , required = true , dataType = "String" , paramType = "header" ) ,
@ApiImplicitParam ( name = " id", value = "抽奖id ", required = true , dataType = "String" , paramType = " query ") ,
@ApiImplicitParam ( name = " reg ionI d", value = " 区域 id", required = true , dataType = "String" , paramType = "query" )
} )
public Result < Void > participate ( @RequestHeader ( "Authorization" ) String token , @NotNull String i d, @NotNull Integer regionI d) {
lotteryService . participate ( id , token , regionId ) ;
return Result . success ( ) ;
}
@ApiOperation ( value = "3.7.自动抽奖结果" , notes = "用这个方法主动触发自动抽奖结果" )
@PostMapping ( "/lottery/auto" )
@GlobalInterceptor ( checkAdminLogin = true )
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "Authorization" , value = "token" , required = true , dataType = "String" , paramType = "header" ) ,
@ApiImplicitParam ( name = "id" , value = "抽奖id" , required = true , dataType = "String" , paramType = "query" )
} )
public Result < Void > auto ( @RequestHeader ( "Authorization" ) String token , @NotNull String id ) {
lotteryService . auto ( id , token ) ;
return Result . success ( ) ;
}
}