package com.trs.ggzyexchange.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.trs.ggzyexchange.api.vo.Result;
import com.trs.ggzyexchange.entity.SourceCodeName;
import com.trs.ggzyexchange.service.SourceCodeNameService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author trs
 * @since 2023-12-20
 */
@RestController
@RequestMapping("/source-code-name")
public class SourceCodeNameController extends BaseController {

    @Autowired
    private SourceCodeNameService venueCodeNameService;

    @GetMapping(value = "/list")
    public Result<List<SourceCodeName>> queryPageList(SourceCodeName sourceCodeName,
                                                      @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
                                                      @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
                                                      HttpServletRequest req) {
        QueryWrapper<SourceCodeName> queryWrapper = new QueryWrapper<SourceCodeName>();
        queryWrapper.orderByAsc("sort");
        List<SourceCodeName> list = venueCodeNameService.list(queryWrapper);
        return Result.OK(list);
    }
}
