|
@@ -19,6 +19,7 @@ import com.fuint.utils.StringUtil;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import java.util.HashMap;
|
|
@@ -50,12 +51,13 @@ public class BackendCommissionLogController extends BaseController {
|
|
|
/**
|
|
|
* 规则列表查询
|
|
|
*
|
|
|
- * @param request HttpServletRequest对象
|
|
|
+ * @param request HttpServletRequest对象
|
|
|
* @return 规则列表
|
|
|
*/
|
|
|
@ApiOperation(value = "规则列表查询")
|
|
|
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
|
|
@CrossOrigin
|
|
|
+ @PreAuthorize("@pms.hasPermission('commissionLog:index')")
|
|
|
public ResponseObject list(HttpServletRequest request) throws BusinessCheckException {
|
|
|
String token = request.getHeader("Access-Token");
|
|
|
Integer page = request.getParameter("page") == null ? Constants.PAGE_NUMBER : Integer.parseInt(request.getParameter("page"));
|
|
@@ -117,6 +119,7 @@ public class BackendCommissionLogController extends BaseController {
|
|
|
@ApiOperation(value = "更新分销提成规则状态")
|
|
|
@RequestMapping(value = "/updateStatus", method = RequestMethod.POST)
|
|
|
@CrossOrigin
|
|
|
+ @PreAuthorize("@pms.hasPermission('commissionLog:index')")
|
|
|
public ResponseObject updateStatus(HttpServletRequest request, @RequestBody Map<String, Object> params) throws BusinessCheckException {
|
|
|
String token = request.getHeader("Access-Token");
|
|
|
String status = params.get("status") != null ? params.get("status").toString() : StatusEnum.ENABLED.getKey();
|
|
@@ -152,6 +155,7 @@ public class BackendCommissionLogController extends BaseController {
|
|
|
@ApiOperation(value = "保存分销提成规则")
|
|
|
@RequestMapping(value = "/save", method = RequestMethod.POST)
|
|
|
@CrossOrigin
|
|
|
+ @PreAuthorize("@pms.hasPermission('commissionLog:index')")
|
|
|
public ResponseObject saveHandler(HttpServletRequest request, @RequestBody CommissionRuleParam params) throws BusinessCheckException {
|
|
|
String token = request.getHeader("Access-Token");
|
|
|
String id = params.getId() == null ? "" : params.getId().toString();
|
|
@@ -187,6 +191,7 @@ public class BackendCommissionLogController extends BaseController {
|
|
|
@ApiOperation(value = "获取分销提成规则详情")
|
|
|
@RequestMapping(value = "/info/{id}", method = RequestMethod.GET)
|
|
|
@CrossOrigin
|
|
|
+ @PreAuthorize("@pms.hasPermission('commissionLog:index')")
|
|
|
public ResponseObject info(HttpServletRequest request, @PathVariable("id") Integer id) throws BusinessCheckException {
|
|
|
String token = request.getHeader("Access-Token");
|
|
|
AccountInfo accountInfo = TokenUtil.getAccountInfoByToken(token);
|