package com.ruixuan.isc.controller; import com.alibaba.fastjson.JSONObject; import com.ruixuan.common.core.controller.BaseController; import com.ruixuan.common.core.domain.AjaxResult; import com.ruixuan.common.core.page.TableDataInfo; import com.ruixuan.isc.entity.KuaishouPromoter; import com.ruixuan.isc.service.IKuaishouPromoterService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import org.springframework.beans.factory.annotation.Autowired; 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; /** * 快手达人 信息Controller * * @author ruoyi * @date 2023-02-03 */ @Api(tags = "快手达人") @RestController @RequestMapping("/kuaishou/promoter") public class KuaishouPromoterController extends BaseController { @Autowired private IKuaishouPromoterService kuaishouPromoterService; /** * 查询快手达人 信息列表 */ @GetMapping("/list") @ApiOperation(value = "查询快手达人") public TableDataInfo list(@ApiParam("创建人ID") @RequestParam(value = "userId", required = true) Long userId, @ApiParam("达人ID") @RequestParam(value = "promoterId", required = false) Long promoterId, @ApiParam("达人名称") @RequestParam(value = "promoterNickName", required = false) String promoterNickName) { List list = kuaishouPromoterService.selectKuaishouPromoterList(userId, promoterId, promoterNickName); return getDataTable(list); } /** * 获取快手达人 信息详细信息 */ @GetMapping(value = "/getById") @ApiOperation(value = "获取快手达人信息详细信息") public AjaxResult getById(@ApiParam("主键") @RequestParam(value = "id", required = true) Long id) { return AjaxResult.success(kuaishouPromoterService.selectKuaishouPromoterById(id)); } /** * 获取快手达人信息 */ @GetMapping(value = "/getPromoterInfo") @ApiOperation(value = "获取快手达人信息") public AjaxResult getPromoterInfo(@ApiParam("达人ID") @RequestParam(value = "promoterId", required = true) Long promoterId) { return kuaishouPromoterService.getPromoterInfo(promoterId); } /** * 新增快手达人 信息 */ @PostMapping(value = "/add") @ApiOperation(value = "新增快手达人") public AjaxResult add(@RequestBody KuaishouPromoter kuaishouPromoter) { return toAjax2(kuaishouPromoterService.insertKuaishouPromoter(kuaishouPromoter)); } /** * 修改快手达人 信息 */ @PostMapping(value = "/edit") @ApiOperation(value = "修改快手达人") public AjaxResult edit(@RequestBody KuaishouPromoter kuaishouPromoter) { return toAjax(kuaishouPromoterService.updateKuaishouPromoter(kuaishouPromoter)); } /** * 删除快手达人 信息 */ @DeleteMapping("/{ids}") // @ApiOperation(value = "删除快手达人") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(kuaishouPromoterService.deleteKuaishouPromoterByIds(ids)); } }