ExpOperationController.java 1.37 KB
package com.topdraw.business.process.rest;

import com.topdraw.business.process.domian.TempCoupon;
import com.topdraw.business.process.domian.TempExp;
import com.topdraw.business.process.service.CouponOperationService;
import com.topdraw.business.process.service.ExpOperationService;
import com.topdraw.common.ResultInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.List;

/**
 * @author XiangHan
 * @date 2021-10-22
 */
@Api(tags = "ExpOperation管理")
@RestController
@RequestMapping("/api/ExpOperation")
public class ExpOperationController {

    @Autowired
    private ExpOperationService expOperationService;

    @PostMapping(value = "/grantExpByManual")
    @ApiOperation("手动发放成长值")
    public ResultInfo grantExpByManual(@Validated @RequestBody TempExp tempExp) {
        List<TempExp> tempExpList = Arrays.asList(tempExp);
        this.expOperationService.grantExpByManual(tempExpList);
        return ResultInfo.success();
    }

}