Newer
Older
newfiber-termite / newfiber-termites-business / newfiber-termites-biz / src / main / java / com / newfiber / termite / controller / JingchuDeviceConfigController.java
@xiongkai xiongkai 14 hours ago 4 KB OTA升级
package com.newfiber.termite.controller;

import com.newfiber.common.core.web.controller.BaseController;
import com.newfiber.common.core.web.domain.Result;
import com.newfiber.common.core.web.page.PageResult;
import com.newfiber.common.log.annotation.Log;
import com.newfiber.common.log.enums.BusinessType;
import com.newfiber.termite.domain.jingchu.JingchuDeviceConfig;
import com.newfiber.termite.domain.request.jingchuDeviceConfig.JingchuDeviceConfigGeneratorRequest;
import com.newfiber.termite.domain.request.jingchuDeviceConfig.JingchuDeviceConfigQueryRequest;
import com.newfiber.termite.domain.request.jingchuDeviceConfig.JingchuDeviceConfigSaveRequest;
import com.newfiber.termite.domain.request.jingchuDeviceConfig.JingchuDeviceConfigUpdateRequest;
import com.newfiber.termite.service.jingchu.IJingchuDeviceConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import javax.annotation.Resource;
import javax.validation.Valid;
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.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 三方对接-荆楚平台设备信息Controller
 *
 * @author X.K
 * @date 2025-01-14
 */
@RestController
@RequestMapping("/jingchuDeviceConfig")
@Api(value = "三方对接-荆楚平台设备信息", tags = "三方对接-荆楚平台设备信息")
public class JingchuDeviceConfigController extends BaseController {

    @Resource
    private IJingchuDeviceConfigService jingchuDeviceConfigService;

    /**
     * 新增三方对接-荆楚平台设备信息
     */
    @PostMapping("add")
    @ApiOperation(value = "新增三方对接-荆楚平台设备信息", position = 10)
    @Log(title = "三方对接-荆楚平台设备信息", businessType = BusinessType.INSERT)
    public Result<Long> add(@Valid @RequestBody JingchuDeviceConfigSaveRequest request) {
        return success(jingchuDeviceConfigService.insert(request));
    }

    /**
     * 修改三方对接-荆楚平台设备信息
     */
    @PutMapping("edit")
    @ApiOperation(value = "修改三方对接-荆楚平台设备信息", position = 20)
    @Log(title = "三方对接-荆楚平台设备信息", businessType = BusinessType.UPDATE)
    public Result<Object> edit(@Valid @RequestBody JingchuDeviceConfigUpdateRequest request) {
        return success(jingchuDeviceConfigService.update(request));
    }

    /**
     * 删除三方对接-荆楚平台设备信息
     */
    @DeleteMapping("/{ids}")
    @ApiOperation(value = "删除三方对接-荆楚平台设备信息", notes = "传入ids(,隔开)", position = 30)
    @Log(title = "三方对接-荆楚平台设备信息", businessType = BusinessType.DELETE)
    public Result<Object> remove(@PathVariable String ids) {
        return success(jingchuDeviceConfigService.delete(ids));
    }

    /**
     */
    @PostMapping("generator")
    @ApiOperation(value = "批量生成", position = 10)
    @Log(title = "批量生成", businessType = BusinessType.INSERT)
    public Result<Long> generator(@Valid @RequestBody JingchuDeviceConfigGeneratorRequest request) {
        return success(jingchuDeviceConfigService.generator(request));
    }

    /**
     * 详细查询三方对接-荆楚平台设备信息
     */
    @GetMapping(value = "/{id}")
    @ApiOperation(value = "详细查询三方对接-荆楚平台设备信息", position = 40)
    public Result<JingchuDeviceConfig> detail(@PathVariable("id") Long id) {
        return success(jingchuDeviceConfigService.selectDetail(id));
    }

    /**
     * 分页查询三方对接-荆楚平台设备信息
     */
    @GetMapping("/page")
    @ApiOperation(value = "分页查询三方对接-荆楚平台设备信息", position = 50)
    public PageResult<List<JingchuDeviceConfig>> page(JingchuDeviceConfigQueryRequest request) {
        startPage();
        List<JingchuDeviceConfig> list = jingchuDeviceConfigService.selectPage(request);
        return pageResult(list);
    }

    /**
     * 列表查询三方对接-荆楚平台设备信息
     */
    @GetMapping("/list")
    @ApiOperation(value = "列表查询三方对接-荆楚平台设备信息", position = 60)
    public Result<List<JingchuDeviceConfig>> list(JingchuDeviceConfigQueryRequest request) {
        List<JingchuDeviceConfig> list = jingchuDeviceConfigService.selectList(request);
        return success(list);
    }

}