zqy
2024-07-25 c8a96c5e4ce5d5013a5ec508e2422f40ecdc311e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package com.ruoyi.web.controller.zhang;
 
 
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.domain.ZfClanManage;
import com.ruoyi.service.ZfClanManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.method.P;
import org.springframework.web.bind.annotation.*;
 
import static com.ruoyi.common.core.page.TableSupport.*;
 
@RestController
@RequestMapping("/ZfClanManage")
public class ZfClanManageController {
    @Autowired
    ZfClanManageService zfClanManageService;
 
    @GetMapping("/all/{clanId}")
    public AjaxResult listAll(@PathVariable Integer clanId){
        Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1);
        Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
        return zfClanManageService.selectDataList(clanId, pageNo, pageSize);
    }
 
    /**
     * 新增家族成员
     */
    @Log(title = "家族管理", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody ZfClanManage zfClanManage)
    {
        return zfClanManageService.addData(zfClanManage);
    }
 
 
    /**
     * 批量删除家族成员
     */
    @Log(title = "家族管理", businessType = BusinessType.DELETE)
    @DeleteMapping("/{clanId}/{id}")
    public AjaxResult remove(@PathVariable Integer id, @PathVariable Integer clanId) {
        return zfClanManageService.deleteData(clanId,id);
    }
}