Skip to content

Commit

Permalink
Merge pull request #271 from facming/feature/bounty_release_permission
Browse files Browse the repository at this point in the history
remove some permission check
  • Loading branch information
yanyanho committed Jul 28, 2024
2 parents a1c1ddb + 0d26f2f commit d4f2e81
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/main/java/com/dl/officialsite/admin/AdminController.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.dl.officialsite.admin;

import cn.hutool.core.util.StrUtil;
import com.dl.officialsite.admin.vo.HireSearchParams;
import com.dl.officialsite.bounty.BountyService;
import com.dl.officialsite.bounty.vo.BountySearchVo;
Expand Down Expand Up @@ -87,11 +88,11 @@ public BaseResponse deleteHire(@RequestParam String adminAddress, @RequestParam
}

@PostMapping("/bounty/all")
public BaseResponse allBounty(@RequestParam String adminAddress,
public BaseResponse allBounty(@RequestParam(required = false) String adminAddress,
@RequestParam(defaultValue = "1") Integer pageNumber,
@RequestParam(defaultValue = "10") Integer pageSize,
@RequestBody BountySearchVo bountySearchParams) {
if (!teamService.checkMemberIsAdmin(adminAddress)) {
if (StrUtil.isNotEmpty(adminAddress) && !teamService.checkMemberIsAdmin(adminAddress)) {
throw new BizException(CodeEnums.NOT_THE_ADMIN);
}
Pageable pageable = PageRequest.of(pageNumber - 1, pageSize,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ public BaseResponse list(@RequestBody BountySearchVo bountySearchVo,
*/
@GetMapping("/detail")
public BaseResponse detail(@RequestParam Long id,
@RequestParam String address,
@RequestParam(defaultValue = "1") Integer pageNumber,
@RequestParam(defaultValue = "10") Integer pageSize) {
BountyVo bountyVo = bountyService.findByIdInternal(id);
Expand All @@ -81,7 +80,7 @@ public BaseResponse detail(@RequestParam Long id,
* 查询bounty申请人下的信息
*/
@GetMapping("/detail/member")
public BaseResponse detailMember(@RequestParam Long id, @RequestParam String address,
public BaseResponse detailMember(@RequestParam Long id,
@RequestParam(defaultValue = "1") Integer pageNumber,
@RequestParam(defaultValue = "10") Integer pageSize) {
Pageable pageable = PageRequest.of(pageNumber - 1, pageSize, Sort.by(Sort.Direction.DESC, "createTime"));
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/dl/officialsite/hiring/HireController.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public BaseResponse update(@RequestParam String address,@RequestBody HiringVO hi
* 查询招聘详情
*/
@GetMapping
public BaseResponse detail(@RequestParam String address,@RequestParam Long id) {
public BaseResponse detail(@RequestParam Long id) {
HiringVO hiringVO = hireService.detail(id);
return BaseResponse.successWithData(hiringVO);
}
Expand All @@ -67,7 +67,7 @@ public BaseResponse detail(@RequestParam String address,@RequestParam Long id) {
* 查询所有招聘
*/
@GetMapping("/all")
public BaseResponse all(@RequestParam String address,
public BaseResponse all(
@RequestParam(defaultValue = "1") Integer pageNumber,
@RequestParam(defaultValue = "10") Integer pageSize) {
Pageable pageable = PageRequest.of(pageNumber - 1, pageSize, Sort.by(Sort.Direction.DESC, "createTime"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ public class LoginFilter extends OncePerRequestFilter {
add("/bounty/list");
add("/nft/WarCraft");
add("/nft/raw/WarCraft");
add("/admin/bounty/all");
add("/bounty/list");
add("/bounty/detail");
add("/bounty/detail/member");
add("/hire/all");
add("/hire/detail");
}} ;

private Set<String> noAddrCheckApis = new HashSet() {{
Expand Down

0 comments on commit d4f2e81

Please sign in to comment.