TestController.java 1.45 KB
package com.order.erp.controller;

import com.canrd.shop.common.annotation.AnonymousAccess;
import com.canrd.shop.common.constant.ServerResult;
import com.canrd.shop.domain.vo.TestQueryVO;
import com.canrd.shop.domain.vo.TestVO;
import com.canrd.shop.service.TestService;
import lombok.extern.slf4j.Slf4j;
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;

import javax.annotation.Resource;

/**
 * @projectName: canrd-services
 * @package: com.canrd.shop.controller
 * @className: TestController
 * @author: xms
 * @description: TODO
 * @date: 2023/3/29 18:53
 * @version: 1.0
 */

@RestController
@RequestMapping("/admin/shop/test")
@Slf4j
public class TestController {

    @Resource
    private TestService testService;

    /**
     * @param queryVO
     * @return
     */
    @AnonymousAccess
    @PostMapping("/demo")
    public ServerResult demo(@RequestBody TestQueryVO queryVO) {
        log.info("查询用户列表:{}", queryVO);
        return ServerResult.success(testService.pageList(queryVO));
    }


    /**
     * @param testVO
     * @return
     */
    @PostMapping("/add")
    public ServerResult add(@RequestBody TestVO testVO) {
        log.info("新增用户列表:{}", testVO);
        testService.add(testVO);
        return ServerResult.success();
    }
}