using New_College.IServices; using New_College.Model; using New_College.Model.Models; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using System; using System.Linq.Expressions; using System.Threading.Tasks; using SqlSugar; namespace New_College.Api.Controllers { [Route("api/[controller]/[action]")] [ApiController] [Authorize] public class MapJobInfoController : ControllerBase { /// /// 服务器接口,因为是模板生成,所以首字母是大写的,自己可以重构下 /// private readonly IOccupationMapJobInfoServices _occupationMapJobInfoServices; public MapJobInfoController(IOccupationMapJobInfoServices OccupationMapJobInfoServices) { _occupationMapJobInfoServices = OccupationMapJobInfoServices; } /// /// 根据职业名称查询岗位信息列表 /// /// /// [HttpGet] public async Task>> Get([FromQuery] OccupationMapJobInfoRequest request) { if (string.IsNullOrWhiteSpace(request.OccupName)) { return new MessageModel>() { msg = "Occupname必填", success = false, status = 200 }; } request.OccupName = "后端开发"; var query = await _occupationMapJobInfoServices.QueryPage(c => SqlFunc.Contains(c.occupName, request.OccupName), request.PageIndex, request.PageSize); return new MessageModel>() { msg = "获取成功", success = true, response = query }; } } }