RightsOperationController.java 1.22 KB
package com.topdraw.business.process.rest;

import com.topdraw.aop.log.Log;
import com.topdraw.business.module.rights.history.domain.RightsHistory;
import com.topdraw.business.process.service.RightsOperationService;
import com.topdraw.common.ResultInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.*;

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


/**
 * @author XiangHan
 * @date 2021-10-22
 */
@Api(tags = "Rights管理")
@RestController
@RequestMapping("/ucEngine/rightsOperation")
public class RightsOperationController {

    @Autowired
    private RightsOperationService rightsOperationService;

    /**
     *
     * @param rightsHistory
     * @return
     */
    @Log("手动发放优惠券")
    @PostMapping(value = "/grantRightsByManual")
    @ApiOperation("手动发放优惠券")
    public ResultInfo grantRightsByManual(@Validated @RequestBody RightsHistory rightsHistory) {
        List<RightsHistory> rightsHistories = Arrays.asList(rightsHistory);
        this.rightsOperationService.grantRightsByManual(rightsHistories);
        return ResultInfo.success();
    }


}