修改mp模块下@SaCheckLogin,将其修改为@SaCheckPermission
This commit is contained in:
parent
365dd9e518
commit
5b00a057c5
@ -1,6 +1,7 @@
|
|||||||
package com.seer.teach.mp.app.controller;
|
package com.seer.teach.mp.app.controller;
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
import cn.dev33.satoken.stp.StpUtil;
|
import cn.dev33.satoken.stp.StpUtil;
|
||||||
import com.seer.teach.common.PageListBean;
|
import com.seer.teach.common.PageListBean;
|
||||||
import com.seer.teach.common.ResultBean;
|
import com.seer.teach.common.ResultBean;
|
||||||
@ -50,7 +51,7 @@ public class AppActivityFormController {
|
|||||||
|
|
||||||
@Operation(summary = "获取活动可用的表单")
|
@Operation(summary = "获取活动可用的表单")
|
||||||
@GetMapping("/{activityId}")
|
@GetMapping("/{activityId}")
|
||||||
@SaCheckLogin
|
@SaCheckPermission("activity.form.view")
|
||||||
public ResultBean<AppActivityFormResp> getFormByActivity(@PathVariable Integer activityId) {
|
public ResultBean<AppActivityFormResp> getFormByActivity(@PathVariable Integer activityId) {
|
||||||
AppActivityFormResp result = appActivityFormService.getFormByActivity(activityId);
|
AppActivityFormResp result = appActivityFormService.getFormByActivity(activityId);
|
||||||
return ResultBean.success(result);
|
return ResultBean.success(result);
|
||||||
@ -58,7 +59,7 @@ public class AppActivityFormController {
|
|||||||
|
|
||||||
@Operation(summary = "获取表单字段列表")
|
@Operation(summary = "获取表单字段列表")
|
||||||
@GetMapping("/field/{templateId}")
|
@GetMapping("/field/{templateId}")
|
||||||
@SaCheckLogin
|
@SaCheckPermission("activity.form.field.view")
|
||||||
public ResultBean<List<AppActivityFormFieldResp>> getFieldList(@PathVariable Integer templateId) {
|
public ResultBean<List<AppActivityFormFieldResp>> getFieldList(@PathVariable Integer templateId) {
|
||||||
List<AppActivityFormFieldResp> result = appActivityFormService.getFieldListByTemplate(templateId);
|
List<AppActivityFormFieldResp> result = appActivityFormService.getFieldListByTemplate(templateId);
|
||||||
return ResultBean.success(result);
|
return ResultBean.success(result);
|
||||||
@ -66,7 +67,7 @@ public class AppActivityFormController {
|
|||||||
|
|
||||||
@Operation(summary = "获取用户提交的表单列表")
|
@Operation(summary = "获取用户提交的表单列表")
|
||||||
@PostMapping("/execution/page-list")
|
@PostMapping("/execution/page-list")
|
||||||
@SaCheckLogin
|
@SaCheckPermission("activity.form.execution.list")
|
||||||
public ResultBean<PageListBean<AppActivityFormExecutionResp>> getExecutionList(@RequestBody @Valid AppActivityFormExecutionQueryReq query) {
|
public ResultBean<PageListBean<AppActivityFormExecutionResp>> getExecutionList(@RequestBody @Valid AppActivityFormExecutionQueryReq query) {
|
||||||
Integer userId = StpUtil.getLoginIdAsInt();
|
Integer userId = StpUtil.getLoginIdAsInt();
|
||||||
PageListBean<AppActivityFormExecutionResp> result = appActivityFormService.getExecutionList(query, userId);
|
PageListBean<AppActivityFormExecutionResp> result = appActivityFormService.getExecutionList(query, userId);
|
||||||
@ -75,7 +76,7 @@ public class AppActivityFormController {
|
|||||||
|
|
||||||
@Operation(summary = "提交表单")
|
@Operation(summary = "提交表单")
|
||||||
@PostMapping("/submit")
|
@PostMapping("/submit")
|
||||||
@SaCheckLogin
|
@SaCheckPermission("activity.form.submit")
|
||||||
public ResultBean<String> submitForm(@RequestBody @Valid ActivityFormSubmitReq req) {
|
public ResultBean<String> submitForm(@RequestBody @Valid ActivityFormSubmitReq req) {
|
||||||
Integer userId = 0;
|
Integer userId = 0;
|
||||||
if (StpUtil.isLogin()) {
|
if (StpUtil.isLogin()) {
|
||||||
@ -87,14 +88,14 @@ public class AppActivityFormController {
|
|||||||
|
|
||||||
@Operation(summary = "获取表单执行详情")
|
@Operation(summary = "获取表单执行详情")
|
||||||
@GetMapping("/execution/{id}")
|
@GetMapping("/execution/{id}")
|
||||||
@SaCheckLogin
|
@SaCheckPermission("activity.form.execution.detail")
|
||||||
public ResultBean<AppActivityFormExecutionResp> getExecutionDetail(@PathVariable Integer id) {
|
public ResultBean<AppActivityFormExecutionResp> getExecutionDetail(@PathVariable Integer id) {
|
||||||
return ResultBean.success(appActivityFormService.getExecutionWithFormData(id));
|
return ResultBean.success(appActivityFormService.getExecutionWithFormData(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "获取提交表单详情")
|
@Operation(summary = "获取提交表单详情")
|
||||||
@GetMapping("/execution/{activityId}/{agentId}")
|
@GetMapping("/execution/{activityId}/{agentId}")
|
||||||
@SaCheckLogin
|
@SaCheckPermission("activity.form.view")
|
||||||
public ResultBean<FormFieldWithValueResp> getFormFieldsWithValues(@PathVariable Integer activityId, @PathVariable Integer agentId) {
|
public ResultBean<FormFieldWithValueResp> getFormFieldsWithValues(@PathVariable Integer activityId, @PathVariable Integer agentId) {
|
||||||
Integer userId = 0;
|
Integer userId = 0;
|
||||||
if (StpUtil.isLogin()) {
|
if (StpUtil.isLogin()) {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
package com.seer.teach.mp.app.controller;
|
package com.seer.teach.mp.app.controller;
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
import cn.dev33.satoken.stp.StpUtil;
|
import cn.dev33.satoken.stp.StpUtil;
|
||||||
import com.seer.teach.common.PageListBean;
|
import com.seer.teach.common.PageListBean;
|
||||||
import com.seer.teach.common.ResultBean;
|
import com.seer.teach.common.ResultBean;
|
||||||
@ -41,7 +41,7 @@ public class AppAgentActivityParentInfoController {
|
|||||||
|
|
||||||
@Operation(summary = "获取参加指定活动的家长列表")
|
@Operation(summary = "获取参加指定活动的家长列表")
|
||||||
@PostMapping("/page-list")
|
@PostMapping("/page-list")
|
||||||
@SaCheckLogin
|
@SaCheckPermission("agent.activity.parent.info.list")
|
||||||
public ResultBean<PageListBean<AgentActivityParentInfoResp>> getActivityParents(@RequestBody @Valid AgentActivityParentQueryReq queryReq) {
|
public ResultBean<PageListBean<AgentActivityParentInfoResp>> getActivityParents(@RequestBody @Valid AgentActivityParentQueryReq queryReq) {
|
||||||
Integer userId = StpUtil.getLoginIdAsInt();
|
Integer userId = StpUtil.getLoginIdAsInt();
|
||||||
return ResultBean.success(agentActivityParentInfoService.getParentsByActivityAndAgent(userId, queryReq));
|
return ResultBean.success(agentActivityParentInfoService.getParentsByActivityAndAgent(userId, queryReq));
|
||||||
@ -49,7 +49,7 @@ public class AppAgentActivityParentInfoController {
|
|||||||
|
|
||||||
@Operation(summary = "记录代理商拨打电话联系家长的次数")
|
@Operation(summary = "记录代理商拨打电话联系家长的次数")
|
||||||
@PostMapping("/record-contact-call")
|
@PostMapping("/record-contact-call")
|
||||||
@SaCheckLogin
|
@SaCheckPermission("agent.activity.parent.info.contact.call")
|
||||||
public ResultBean<Boolean> recordContactCall(@RequestBody @Valid RecordContactCallReq req) {
|
public ResultBean<Boolean> recordContactCall(@RequestBody @Valid RecordContactCallReq req) {
|
||||||
Integer userId = StpUtil.getLoginIdAsInt();
|
Integer userId = StpUtil.getLoginIdAsInt();
|
||||||
return ResultBean.success(agentActivityParentInfoService.recordContactCall(req.getCollectionId(), req.getIncrementCount(),userId));
|
return ResultBean.success(agentActivityParentInfoService.recordContactCall(req.getCollectionId(), req.getIncrementCount(),userId));
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
package com.seer.teach.mp.app.controller;
|
package com.seer.teach.mp.app.controller;
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
import com.seer.teach.common.PageListBean;
|
import com.seer.teach.common.PageListBean;
|
||||||
import com.seer.teach.common.ResultBean;
|
import com.seer.teach.common.ResultBean;
|
||||||
import com.seer.teach.common.annotation.LogPrint;
|
import com.seer.teach.common.annotation.LogPrint;
|
||||||
@ -13,7 +13,14 @@ import io.swagger.v3.oas.annotations.Operation;
|
|||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
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.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -28,21 +35,21 @@ public class AppAgentEmployeeRelationController {
|
|||||||
|
|
||||||
@Operation(summary = "我的员工列表")
|
@Operation(summary = "我的员工列表")
|
||||||
@PostMapping("/page-list")
|
@PostMapping("/page-list")
|
||||||
@SaCheckLogin
|
@SaCheckPermission("agent.employee.page-list")
|
||||||
public ResultBean<PageListBean<AppAgentEmployeeRelationResp>> pageList(@RequestBody @Validated AppAgentEmployeeRelationQueryReq query) {
|
public ResultBean<PageListBean<AppAgentEmployeeRelationResp>> pageList(@RequestBody @Validated AppAgentEmployeeRelationQueryReq query) {
|
||||||
return ResultBean.success(agentEmployeeRelationService.pageList(query));
|
return ResultBean.success(agentEmployeeRelationService.pageList(query));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "新增员工")
|
@Operation(summary = "新增员工")
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
@SaCheckLogin
|
@SaCheckPermission("agent.employee.add")
|
||||||
public ResultBean<Boolean> addEmployee(@RequestBody @Validated AppAgentEmployeeRelationReq request) {
|
public ResultBean<Boolean> addEmployee(@RequestBody @Validated AppAgentEmployeeRelationReq request) {
|
||||||
return ResultBean.success(agentEmployeeRelationService.addEmployee(request));
|
return ResultBean.success(agentEmployeeRelationService.addEmployee(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "更新员工信息")
|
@Operation(summary = "更新员工信息")
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
@SaCheckLogin
|
@SaCheckPermission("agent.employee.update")
|
||||||
public ResultBean<Boolean> updateEmployee(@RequestBody @Validated AppAgentEmployeeRelationReq request) {
|
public ResultBean<Boolean> updateEmployee(@RequestBody @Validated AppAgentEmployeeRelationReq request) {
|
||||||
boolean belongsToAgent = agentEmployeeRelationService.isEmployeeBelongsToAgent(request.getId(),request.getAgentId());
|
boolean belongsToAgent = agentEmployeeRelationService.isEmployeeBelongsToAgent(request.getId(),request.getAgentId());
|
||||||
if (!belongsToAgent) {
|
if (!belongsToAgent) {
|
||||||
@ -53,7 +60,7 @@ public class AppAgentEmployeeRelationController {
|
|||||||
|
|
||||||
@Operation(summary = "删除员工")
|
@Operation(summary = "删除员工")
|
||||||
@DeleteMapping("/{id}")
|
@DeleteMapping("/{id}")
|
||||||
@SaCheckLogin
|
@SaCheckPermission("agent.employee.delete")
|
||||||
public ResultBean<Boolean> deleteEmployee(@PathVariable Integer id, @RequestParam Integer agentId) {
|
public ResultBean<Boolean> deleteEmployee(@PathVariable Integer id, @RequestParam Integer agentId) {
|
||||||
boolean belongsToAgent = agentEmployeeRelationService.isEmployeeBelongsToAgent(id,agentId);
|
boolean belongsToAgent = agentEmployeeRelationService.isEmployeeBelongsToAgent(id,agentId);
|
||||||
if (!belongsToAgent) {
|
if (!belongsToAgent) {
|
||||||
@ -64,7 +71,7 @@ public class AppAgentEmployeeRelationController {
|
|||||||
|
|
||||||
@Operation(summary = "员工详情")
|
@Operation(summary = "员工详情")
|
||||||
@GetMapping("/{id}")
|
@GetMapping("/{id}")
|
||||||
@SaCheckLogin
|
@SaCheckPermission("agent.employee.detail")
|
||||||
public ResultBean<AppAgentEmployeeRelationResp> getEmployee(@PathVariable Integer id,@RequestParam Integer agentId) {
|
public ResultBean<AppAgentEmployeeRelationResp> getEmployee(@PathVariable Integer id,@RequestParam Integer agentId) {
|
||||||
boolean belongsToAgent = agentEmployeeRelationService.isEmployeeBelongsToAgent(id,agentId);
|
boolean belongsToAgent = agentEmployeeRelationService.isEmployeeBelongsToAgent(id,agentId);
|
||||||
if (!belongsToAgent) {
|
if (!belongsToAgent) {
|
||||||
@ -76,7 +83,7 @@ public class AppAgentEmployeeRelationController {
|
|||||||
|
|
||||||
@Operation(summary = "获取所有员工列表")
|
@Operation(summary = "获取所有员工列表")
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
@SaCheckLogin
|
@SaCheckPermission("agent.employee.all")
|
||||||
public ResultBean<List<AppAgentEmployeeRelationResp>> getAllEmployees(@RequestParam Integer agentId) {
|
public ResultBean<List<AppAgentEmployeeRelationResp>> getAllEmployees(@RequestParam Integer agentId) {
|
||||||
return ResultBean.success(agentEmployeeRelationService.getAllEmployeesByAgentId(agentId));
|
return ResultBean.success(agentEmployeeRelationService.getAllEmployeesByAgentId(agentId));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
package com.seer.teach.mp.app.controller;
|
package com.seer.teach.mp.app.controller;
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
import cn.dev33.satoken.stp.StpUtil;
|
import cn.dev33.satoken.stp.StpUtil;
|
||||||
import com.seer.teach.common.ResultBean;
|
import com.seer.teach.common.ResultBean;
|
||||||
import com.seer.teach.mp.app.controller.req.AppMpSignUpActivityReq;
|
import com.seer.teach.mp.app.controller.req.AppMpSignUpActivityReq;
|
||||||
@ -14,7 +14,13 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
|||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
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;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 家长参与代理商活动控制器 - 应用端
|
* 家长参与代理商活动控制器 - 应用端
|
||||||
@ -28,8 +34,8 @@ public class AppParentAgentActivityController {
|
|||||||
private final AppParentAgentActivityService appParentAgentActivityService;
|
private final AppParentAgentActivityService appParentAgentActivityService;
|
||||||
|
|
||||||
@PostMapping("/sign-up")
|
@PostMapping("/sign-up")
|
||||||
@SaCheckLogin
|
|
||||||
@Operation(summary = "家长报名参加代理商活动")
|
@Operation(summary = "家长报名参加代理商活动")
|
||||||
|
@SaCheckPermission("parent.agent.activity.signup")
|
||||||
public ResultBean<Boolean> signUpForActivity(@RequestBody @Validated AppMpSignUpActivityReq request) {
|
public ResultBean<Boolean> signUpForActivity(@RequestBody @Validated AppMpSignUpActivityReq request) {
|
||||||
Integer parentId = 0;
|
Integer parentId = 0;
|
||||||
if (StpUtil.isLogin()) {
|
if (StpUtil.isLogin()) {
|
||||||
@ -39,23 +45,23 @@ public class AppParentAgentActivityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/update-info")
|
@PostMapping("/update-info")
|
||||||
@SaCheckLogin
|
|
||||||
@Operation(summary = "家长更新活动信息")
|
@Operation(summary = "家长更新活动信息")
|
||||||
|
@SaCheckPermission("parent.agent.activity.update")
|
||||||
public ResultBean<Boolean> updateActivityInfo(@RequestBody @Validated AppMpSignUpActivityReq request) {
|
public ResultBean<Boolean> updateActivityInfo(@RequestBody @Validated AppMpSignUpActivityReq request) {
|
||||||
Integer parentId = StpUtil.getLoginIdAsInt();
|
Integer parentId = StpUtil.getLoginIdAsInt();
|
||||||
return ResultBean.success(appParentAgentActivityService.updateActivityInfo(request, parentId));
|
return ResultBean.success(appParentAgentActivityService.updateActivityInfo(request, parentId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/cancel/{id}")
|
@DeleteMapping("/cancel/{id}")
|
||||||
@SaCheckLogin
|
|
||||||
@Operation(summary = "取消报名参加代理商活动")
|
@Operation(summary = "取消报名参加代理商活动")
|
||||||
|
@SaCheckPermission("parent.agent.activity.cancel")
|
||||||
public ResultBean<Boolean> cancelSignUp(@PathVariable("id") Integer id) {
|
public ResultBean<Boolean> cancelSignUp(@PathVariable("id") Integer id) {
|
||||||
Integer parentId = StpUtil.getLoginIdAsInt();
|
Integer parentId = StpUtil.getLoginIdAsInt();
|
||||||
return ResultBean.success(appParentAgentActivityService.cancelSignUp(id, parentId));
|
return ResultBean.success(appParentAgentActivityService.cancelSignUp(id, parentId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/{agentId}/{activityId}/info")
|
@GetMapping("/{agentId}/{activityId}/info")
|
||||||
@SaCheckLogin
|
@SaCheckPermission("parent.agent.activity.info")
|
||||||
@Operation(summary = "获取家长参与代理商活动详情")
|
@Operation(summary = "获取家长参与代理商活动详情")
|
||||||
public ResultBean<AppMpSignUpActivityResp> getRelationById(@PathVariable("agentId") Integer agentId, @PathVariable("activityId") Integer activityId) {
|
public ResultBean<AppMpSignUpActivityResp> getRelationById(@PathVariable("agentId") Integer agentId, @PathVariable("activityId") Integer activityId) {
|
||||||
Integer parentId = StpUtil.getLoginIdAsInt();
|
Integer parentId = StpUtil.getLoginIdAsInt();
|
||||||
@ -63,7 +69,7 @@ public class AppParentAgentActivityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/test-child-character")
|
@PostMapping("/test-child-character")
|
||||||
@SaCheckLogin
|
@SaCheckPermission("parent.agent.activity.child.character.test")
|
||||||
@Operation(summary = "AI测试孩子性格")
|
@Operation(summary = "AI测试孩子性格")
|
||||||
public ResultBean<TestChildCharacterResp> testChildCharacter(@RequestBody @Valid TestChildCharacterReq request) {
|
public ResultBean<TestChildCharacterResp> testChildCharacter(@RequestBody @Valid TestChildCharacterReq request) {
|
||||||
Integer parentId = StpUtil.getLoginIdAsInt();
|
Integer parentId = StpUtil.getLoginIdAsInt();
|
||||||
@ -71,7 +77,7 @@ public class AppParentAgentActivityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/get-child-character")
|
@GetMapping("/get-child-character")
|
||||||
@SaCheckLogin
|
@SaCheckPermission("parent.agent.activity.child.character.get")
|
||||||
@Operation(summary = "获取AI测试性格报告")
|
@Operation(summary = "获取AI测试性格报告")
|
||||||
public ResultBean<AppChildCharacterResp> getChildCharacter() {
|
public ResultBean<AppChildCharacterResp> getChildCharacter() {
|
||||||
Integer parentId = StpUtil.getLoginIdAsInt();
|
Integer parentId = StpUtil.getLoginIdAsInt();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user