我是靠谱客的博主 单身红牛,最近开发中收集的这篇文章主要介绍调用api接口(在api中写自己需要的方法),觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

跨模块(跨项目)是调用不到里面的方法的,如果想用其他模块里面的方法就需要自己去写api调用.

具体方法流程如下:

        1.首先在api下写自己需要的接口

                

                      ①vo类

package com.sinosoft.springbootplus.schedule.vo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.sinosoft.springbootplus.common.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;

/**
 * <pre>
 * 课程表排课详情信息表
 * </pre>
 *
 * lijiakai
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "JwPtkScheduleCourseDetail对象", description = "课程表排课详情信息表 ")
public class JwPtkScheduleCourseDetailByClassId extends BaseEntity {

    private static final long serialVersionUID = 1L;

    public static final Integer MORNING = 1;    //早上
    public static final Integer AFTERNOON = 2;  //下午
    public static final Integer EVENING = 3;    //晚上

    public static final Integer COURSE = 0;
    public static final Integer ACTIVITY = 1;

    @ApiModelProperty(value = "主键", required = true)
    @TableId(value = "id", type = IdType.ID_WORKER)
    private Long id;

    @ApiModelProperty(value = "课程表id", required = true)
    @NotNull(message = "课程表id不能为空")
    private Long scheduleId;

    @ApiModelProperty(value = "班级课程id", required = true)
    @NotNull(message = "班级课程id不能为空")
    private Long classCourseId;

    @ApiModelProperty(value = "课程库id")
    private Long courseId;

    @ApiModelProperty(value = "课程类型 课程类型 0课程 1活动")
    private Integer courseType;

    @ApiModelProperty(value = "课程名称")
    private String courseName;

    @ApiModelProperty(value = "上课日期", required = true)
    @NotNull(message = "上课日期不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date courseDate;

    @ApiModelProperty(value = "上课时间 1:上午 2:下午 3:晚上", required = true)
    @NotNull(message = "上课时间 1:上午 2:下午 3:晚上不能为空")
    private Integer courseTime;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "时间段内排序 课程在一个时间段(上午/下午/晚上)内的排序", required = true)
    @NotNull(message = "时间段内排序 课程在一个时间段(上午/下午/晚上)内的排序不能为空")
    private Integer timeFrameOrder;

    @ApiModelProperty(value = "课程开始时间")
    private String courseBeginTime;

    @ApiModelProperty(value = "课程结束时间")
    private String courseEndTime;

   /* @ApiModelProperty(value = "主讲/主持 主讲/主持集合")
    @TableField(exist = false)
    private List<JwPtkTeacherInfo> teacherList;*/

    @ApiModelProperty(value = "职务职称 所选的最后一位讲师的职务职称")
    @TableField(exist = false)
    private String duty;

    @ApiModelProperty(value = "工作单位")
    @TableField(exist = false)
    private String workUnit;

    @ApiModelProperty(value = "审核人")
    private String approvalUser;

    @ApiModelProperty(value = "审核人ID")
    private String approvalUserId;

    @ApiModelProperty(value = "审核状态")
    private int approvalStatus;

    @ApiModelProperty(value = "教室名称")
    private String classroom;

    @ApiModelProperty(value = "教室备注")
    private String classRoomRemark;

    @ApiModelProperty(value = "教室人数")
    private String trueNum;




}

                         ②写mapper

package com.sinosoft.springbootplus.schedule.domain.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sinosoft.springbootplus.course.vo.JxSkRecordVo;
import com.sinosoft.springbootplus.project.vo.JwPtkBaseInfoVo;
import com.sinosoft.springbootplus.schedule.domain.entity.JwPtkCourseAssessInfo;
import com.sinosoft.springbootplus.schedule.domain.entity.JwPtkScheduleCourseDetail;
import com.sinosoft.springbootplus.schedule.vo.JwPtkScheduleCourseDetailByClassId;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <pre>
 * 课程表排课详情信息表  Mapper 接口
 * </pre>
 *
 * @author df
 * @since 2020-06-19
 */
@Repository
public interface JwPtkScheduleCourseDetailMapper extends BaseMapper<JwPtkScheduleCourseDetail> {

    /**
     * 获取分页对象
     *
     * @param page 分页信息
     * @param wrapper 课程表排课详情信息表 查询参数
     * @return
     */
    @Select("select id, schedule_id, class_course_id, course_id, course_type, course_name, course_date, course_time, remark, time_frame_order ,classroom ,class_room_remark FROM jw_ptk_schedule_course_detail  ${ew.customSqlSegment}")
    IPage<JwPtkScheduleCourseDetail> getJwPtkScheduleCourseDetailPageList(Page page, @Param(Constants.WRAPPER) Wrapper<JwPtkScheduleCourseDetail> wrapper);

    /**
     * 删除课程讲师中间表中的脏数据
     * @param wrapper 查询参数
     * @return
     */
    @Delete("delete FROM jw_ptk_course_teacher_mid where schedule_course_id in (select id from jw_ptk_schedule_course_detail ${ew.customSqlSegment})")
    int deletedWithJwPtkCourseTeacherMid(@Param(Constants.WRAPPER) Wrapper<JwPtkScheduleCourseDetail> wrapper);

    /**
     * 根据移除或调整日期的课程修改其排序之后的课程的排序
     * @param wrapper
     * @return
     */
    @Update("update jw_ptk_schedule_course_detail set time_frame_order = time_frame_order-1 ${ew.customSqlSegment}")
    int updateTimeFrameOrderByDeleteCourse(@Param(Constants.WRAPPER) Wrapper<JwPtkScheduleCourseDetail> wrapper);

    @Select("select info.class_id from jw_ptk_schedule_course_detail detail LEFT JOIN jw_ptk_schedule_baseinfo info on detail.schedule_id = info.id where detail.id = #{scheduleCourseId}")
    Long getClassIdByScheduleCourseId(Long scheduleCourseId);

    /**
     * 根据班级课表id查询所需评估的课程信息
     * @param scheduleId
     * @return
     */
    @Select("select d.course_id,d.course_name,d.course_date,t.id teacher_id,t.name teacher_name from jw_ptk_schedule_course_detail d LEFT JOIN jw_ptk_course_teacher_mid m on d.id = m.schedule_course_id LEFT JOIN jw_ptk_teacher_info t on m.teacher_id = t.id where d.schedule_id = #{scheduleId} and m.teacher_type = 1")
    List<JwPtkCourseAssessInfo> getCourseOfPg(Long scheduleId);

    /**
     * 根据课程评估信息查询该课程的排课信息
     * @param classId
     * @param courseId
     * @param teacherId
     * @return
     */
    @Select("select d.course_id,d.course_name,d.course_date,c.way from jw_ptk_schedule_course_detail d LEFT JOIN jw_ptk_schedule_baseinfo s on d.schedule_id = s.id LEFT JOIN jw_ptk_course_baseinfo c on d.class_course_id = c.id LEFT JOIN jw_ptk_course_teacher_mid m on m.schedule_course_id = d.id where s.class_id = #{classId} and d.course_id = #{courseId} and m.teacher_id = #{teacherId} limit 1")
    JwPtkCourseAssessInfo getCourseDetailInfoByAssessInfo(@Param("classId")Long classId,@Param("courseId")Long courseId,@Param("teacherId")Long teacherId);

    @Select("SELECT jpctm.teacher_id AS teacherId, jpscd.schedule_id AS scheduleId, jpti.name AS teacherName, jpscd.course_id AS courseId, jpscd.course_name AS courseName, jpscd.course_date AS courseDate, jpscd.course_time AS courseTime FROM jw_ptk_schedule_course_detail jpscd LEFT JOIN jw_ptk_course_teacher_mid jpctm ON jpscd.id = jpctm.schedule_course_id LEFT JOIN jw_ptk_teacher_info jpti ON jpctm.teacher_id = jpti.id ${ew.customSqlSegment}")
    IPage<JxSkRecordVo> getLectureRecordsPaging(Page page, @Param(Constants.WRAPPER) QueryWrapper wrapper);

    @Update("update jw_ptk_schedule_course_detail set course_begin_time = null ${ew.customSqlSegment}")
    int updateCourseBeginTimeById(@Param(Constants.WRAPPER) QueryWrapper wrapper);

    @Update("update jw_ptk_schedule_course_detail set course_end_time = null ${ew.customSqlSegment}")
    int updateCourseEndTimeById(@Param(Constants.WRAPPER) QueryWrapper wrapper);

    @Select("select detail.course_name,detail.course_begin_time,detail.course_end_time,detail.course_time,detail.course_date from jw_ptk_schedule_course_detail detail left join jw_ptk_course_teacher_mid mid on detail.id = mid.schedule_course_id left join jw_ptk_schedule_baseinfo base on base.id = detail.schedule_id ${ew.customSqlSegment}")
    List<JwPtkScheduleCourseDetail> getTeacherAllCourseHourByClass(@Param(Constants.WRAPPER) QueryWrapper wrapper);

    @Select("select count(0) from jw_ptk_schedule_course_detail detail left join jw_ptk_schedule_baseinfo base on base.id = detail.schedule_id ${ew.customSqlSegment}")
    int getCourseCountByClassId(@Param(Constants.WRAPPER) QueryWrapper wrapper);

    @Select("select id , schedule_id, class_course_id from jw_ptk_schedule_course_detail where schedule_id = #{scheduleId} ")
    List<JwPtkScheduleCourseDetail> selectByscheduleId(@Param("scheduleId") Long scheduleId);

    @Select("select a.id,a.course_begin_time,a.course_end_time,a.classroom,a.remark,b.class_id,c.true_num from jw_ptk_schedule_course_detail a join jw_ptk_schedule_baseinfo b on a.schedule_id=b.id  join jw_bj_baseinfo c on c.id=b.class_id  where b.class_id=#{classId}")
    List<JwPtkScheduleCourseDetailByClassId> getJwPtkScheduleCourseDetailByClassId(@Param("classId") Long classId);

    @Update("update jw_ptk_schedule_course_detail set remark = #{remark} where id = #{id}")
    int updateJwPtkScheduleCourseDetailByClassId(@Param("id") Long id,@Param("remark") String remark);

    @Select(" select ptk.id as ptk_id, ptk.course_name,ptkb.class_name, ptkt.name as teacher_name from jw_ptk_schedule_course_detail ptk " +
            " LEFT JOIN jw_ptk_schedule_baseinfo ptkb ON ptkb.id = ptk.schedule_id" +
            " LEFT JOIN jw_ptk_course_teacher_mid ptkm ON ptkm.schedule_course_id = ptk.id " +
            " LEFT JOIN jw_ptk_teacher_info ptkt ON ptkt.id = ptkm.teacher_id " +
            "where ptk.id= #{ptkId}")
    JwPtkBaseInfoVo selectByPtkId(Long ptkId);
}

                           ③创建接口

package com.sinosoft.springbootplus.schedule.service;

import com.sinosoft.springbootplus.schedule.vo.JwPtkScheduleCourseDetailByClassId;

import java.util.List;


/**
 * <pre>
 * 培训保障单  服务类
 * </pre>
 *
 * @author lijakai
 * @since 2021-12-8
 */
public interface JwPtkScheduleCourseDetailByClassIdApiService {

    /**
     * lijiakai
     * @param classId
     * @return
     */
    List<JwPtkScheduleCourseDetailByClassId> getJwPtkScheduleCourseDetailByClassId(Long classId);

    boolean updateJwPtkScheduleCourseDetail(Long id,String remark);
}

         2.在项目模块里的impl里面创建实现类并实现上方接口.

        ​​​​​​​        

package com.sinosoft.springbootplus.schedule.application.service.impl;

import com.sinosoft.springbootplus.mybatis.service.impl.BaseServiceImpl;
import com.sinosoft.springbootplus.schedule.domain.entity.JwPtkScheduleCourseDetail;
import com.sinosoft.springbootplus.schedule.domain.mapper.JwPtkScheduleCourseDetailMapper;
import com.sinosoft.springbootplus.schedule.service.JwPtkScheduleCourseDetailByClassIdApiService;
import com.sinosoft.springbootplus.schedule.vo.JwPtkScheduleCourseDetailByClassId;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * lijiakai
 */
@Slf4j
@Service
public class JwPtkScheduleCourseDetailByClassIdServiceImpl extends BaseServiceImpl<JwPtkScheduleCourseDetailMapper, JwPtkScheduleCourseDetail> implements JwPtkScheduleCourseDetailByClassIdApiService {
    private JwPtkScheduleCourseDetailMapper jwPtkScheduleCourseDetailMapper;
    JwPtkScheduleCourseDetailByClassIdServiceImpl (JwPtkScheduleCourseDetailMapper jwPtkScheduleCourseDetailMapper){
        this.jwPtkScheduleCourseDetailMapper =jwPtkScheduleCourseDetailMapper;
    }

    @Override
    public List<JwPtkScheduleCourseDetailByClassId> getJwPtkScheduleCourseDetailByClassId(Long classId) {
        List<JwPtkScheduleCourseDetailByClassId> jwPtkScheduleCourseDetailByClassId = jwPtkScheduleCourseDetailMapper.getJwPtkScheduleCourseDetailByClassId(classId);
        return jwPtkScheduleCourseDetailByClassId;
    }

    /**
     * 修改备注
     * lijiakai
     * @param id
     * @param remark
     * @return
     */
    @Override
    public boolean updateJwPtkScheduleCourseDetail(Long id, String remark) {
        int i = jwPtkScheduleCourseDetailMapper.updateJwPtkScheduleCourseDetailByClassId(id, remark);
        if (i > 0){
            return true;
        }else {
            return false;
        }

    }
}

 3.在自己的模块中完成方法的调用.

在service层完成方法的调用.

                ①接口(里面最后俩方法才是)

package com.sinosoft.springbootplus.demandConfirm.application.service;

import com.sinosoft.springbootplus.demandConfirm.domain.entity.HqDemandConfirm;
import com.sinosoft.springbootplus.demandConfirm.param.HqDemandConfirmQueryParam;

import com.sinosoft.springbootplus.demandConfirm.vo.HqDemandConfirmQueryVo;
import com.sinosoft.springbootplus.mybatis.service.BaseService;

import com.sinosoft.springbootplus.mybatis.vo.Paging;
import com.sinosoft.springbootplus.schedule.vo.JwPtkScheduleCourseDetailByClassId;

import java.util.List;

/**
 * <pre>
 * 后勤需求确认单 服务类
 * </pre>
 *
 * @author 李佳锴
 * @since 2021-11-18
 */
public interface HqDemandConfirmService extends BaseService<HqDemandConfirm> {

    /**
     * 保存
     *
     * @param hqDemandConfirm
     * @return
     * @throws Exception
     */
    boolean saveHqDemandConfirm(HqDemandConfirm hqDemandConfirm) throws Exception;

    /**
     * 修改
     *
     * @param hqDemandConfirm
     * @return
     * @throws Exception
     */
    boolean updateHqDemandConfirm(HqDemandConfirm hqDemandConfirm) throws Exception;

    /**
     * 删除
     *
     * @param id
     * @return
     * @throws Exception
     */
    boolean deleteHqDemandConfirm(Long id) throws Exception;

    /**
     * 获取分页对象
     *
     * @param hqDemandConfirmQueryParam 后勤需求确认单 查询参数
     * @return
     * @throws Exception
     */
    Paging<HqDemandConfirmQueryVo> getHqDemandConfirmPageList(HqDemandConfirmQueryParam hqDemandConfirmQueryParam) throws Exception;

    /**
     * lijiakai
     * @return
     */
    List<JwPtkScheduleCourseDetailByClassId> getVenueInfoPageList(HqDemandConfirmQueryParam hqDemandConfirmQueryParam);

    boolean updateVenueInfoPageList(Long id,String remark);

}

         ②实现类(里面最后俩方法才是)

package com.sinosoft.springbootplus.demandConfirm.application.service.impl;


import com.sinosoft.springbootplus.demandConfirm.application.service.HqDemandConfirmService;
import com.sinosoft.springbootplus.demandConfirm.domain.entity.HqDemandConfirm;
import com.sinosoft.springbootplus.demandConfirm.domain.mapper.HqDemandConfirmMapper;
import com.sinosoft.springbootplus.demandConfirm.param.HqDemandConfirmQueryParam;
import com.sinosoft.springbootplus.demandConfirm.vo.HqDemandConfirmQueryVo;
import com.sinosoft.springbootplus.mybatis.service.impl.BaseServiceImpl;
import com.sinosoft.springbootplus.mybatis.vo.Paging;
import com.sinosoft.springbootplus.schedule.service.JwPtkScheduleCourseDetailByClassIdApiService;
import com.sinosoft.springbootplus.schedule.vo.JwPtkScheduleCourseDetailByClassId;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;

import java.util.ArrayList;
import java.util.List;


/**
 * <pre>
 * 后勤需求确认单 服务实现类
 * </pre>
 *
 * @author 李佳锴
 * @since 2021-11-18
 */
@Slf4j
@Service
public class HqDemandConfirmServiceImpl extends BaseServiceImpl<HqDemandConfirmMapper, HqDemandConfirm> implements HqDemandConfirmService{

    private HqDemandConfirmMapper hqDemandConfirmMapper;

    private JwPtkScheduleCourseDetailByClassIdApiService jwPtkScheduleCourseDetailByClassIdApiService;
        HqDemandConfirmServiceImpl (HqDemandConfirmMapper hqDemandConfirmMapper,JwPtkScheduleCourseDetailByClassIdApiService jwPtkScheduleCourseDetailByClassIdApiService){
            this.hqDemandConfirmMapper =hqDemandConfirmMapper;
            this.jwPtkScheduleCourseDetailByClassIdApiService=jwPtkScheduleCourseDetailByClassIdApiService;

        }


    @Transactional(rollbackFor = Exception.class)
    @Override
    public boolean saveHqDemandConfirm(HqDemandConfirm hqDemandConfirm)  {
        return super.save(hqDemandConfirm);
    }

    @Transactional(rollbackFor = Exception.class)
    @Override
    public boolean updateHqDemandConfirm(HqDemandConfirm hqDemandConfirm) {

        return super.updateById(hqDemandConfirm);
    }

    @Transactional(rollbackFor = Exception.class)
    @Override
    public boolean deleteHqDemandConfirm(Long id)  {
        return super.removeById(id);
    }

    @Override
    public Paging<HqDemandConfirmQueryVo> getHqDemandConfirmPageList(HqDemandConfirmQueryParam hqDemandConfirmQueryParam) {
        QueryWrapper<HqDemandConfirm> queryWrapper = Wrappers.<HqDemandConfirm>query()
                                        .eq("confirm_static",hqDemandConfirmQueryParam.getConfirmStatic())
                        .like(hqDemandConfirmQueryParam.getConfirmName()!= null,"confirm_name",hqDemandConfirmQueryParam.getConfirmName())
                        //  .eq(hqDemandConfirmQueryParam.getCheckOutStartDate() != null,"check_out_start_date",hqDemandConfirmQueryParam.getCheckOutStartDate())
                        .ge(hqDemandConfirmQueryParam.getCheckOutStartDate() != null,"check_out_start_date",hqDemandConfirmQueryParam.getCheckOutStartDate())
                        .le(hqDemandConfirmQueryParam.getCheckOutEndDate() != null,"check_out_start_date",hqDemandConfirmQueryParam.getCheckOutEndDate())
                        .between(hqDemandConfirmQueryParam.getSchoolBeginDate() != null && hqDemandConfirmQueryParam.getSchoolEndDate() != null,"school_date",hqDemandConfirmQueryParam.getSchoolBeginDate(),hqDemandConfirmQueryParam.getSchoolEndDate());
        IPage<HqDemandConfirmQueryVo> iPage = hqDemandConfirmMapper.getHqDemandConfirmPageList(hqDemandConfirmQueryParam.page(),queryWrapper);
        return new Paging<>(iPage);
    }

    /**
     * lijiakai
     * @param
     * @return
     */
    @Override
    public List<JwPtkScheduleCourseDetailByClassId> getVenueInfoPageList(HqDemandConfirmQueryParam hqDemandConfirmQueryParam) {
        //获取培训单所有信息
        List<HqDemandConfirm> hqDemandConfirms = hqDemandConfirmMapper.selectList(null);
        //获取培训单所有班级Id
        List<Long> list = new ArrayList<>();
        for (HqDemandConfirm demandConfirm : hqDemandConfirms) {
            list.add(demandConfirm.getClassId());
        }
        //根据班级Id获取场地所有信息
        List list2=new ArrayList<>();
        for (Long aLong : list) {
            List<JwPtkScheduleCourseDetailByClassId> jwPtkScheduleCourseDetailByClassId = jwPtkScheduleCourseDetailByClassIdApiService.getJwPtkScheduleCourseDetailByClassId(aLong);
                for (JwPtkScheduleCourseDetailByClassId ptkScheduleCourseDetailByClassId : jwPtkScheduleCourseDetailByClassId) {
                    list2.add(ptkScheduleCourseDetailByClassId);
                }
        }
        return list2;
    }

    /**
     * 修改排调课备注
     * @param id
     * @param remark
     * @return
     */
    @Override
    public boolean updateVenueInfoPageList(Long id, String remark) {
        boolean b = jwPtkScheduleCourseDetailByClassIdApiService.updateJwPtkScheduleCourseDetail(id, remark);
        return b;
    }


}

                ③写controller层

package com.sinosoft.springbootplus.demandConfirm.controller;


import com.sinosoft.springbootplus.common.api.ApiResult;
import com.sinosoft.springbootplus.common.controller.BaseController;
import com.sinosoft.springbootplus.demandConfirm.application.service.HqDemandConfirmService;
import com.sinosoft.springbootplus.demandConfirm.domain.entity.HqDemandConfirm;
import com.sinosoft.springbootplus.demandConfirm.param.HqDemandConfirmQueryParam;
import com.sinosoft.springbootplus.demandConfirm.param.HqJwPtkScheduleCourseDetailQueryParams;
import com.sinosoft.springbootplus.demandConfirm.vo.HqDemandConfirmQueryVo;
import com.sinosoft.springbootplus.schedule.vo.JwPtkScheduleCourseDetailByClassId;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

import com.sinosoft.springbootplus.mybatis.vo.Paging;

import java.util.List;

/**
 * <pre>
 * 后勤需求确认单 API接口
 * </pre>
 *
 * @author 李佳锴
 * @since 2021-11-18
 */
@Slf4j
@RestController
@RequestMapping("/hqDemandConfirm")
@Api(tags="后勤需求确认单 API",description = "提供后勤需求确认单相关的 Rest API")
public class HqDemandConfirmController extends BaseController {

    private HqDemandConfirmService hqDemandConfirmService;
    HqDemandConfirmController(HqDemandConfirmService hqDemandConfirmService){
        this.hqDemandConfirmService =hqDemandConfirmService ;
    }


    /**
     * 添加后勤需求确认单
     */
    @PostMapping("/add")
    @RequiresPermissions("hq:demand:confirm:add")
    @ApiOperation(value = "添加HqDemandConfirm对象", notes = "添加后勤需求确认单")
    public ApiResult<Boolean> addHqDemandConfirm(@Valid @RequestBody HqDemandConfirm hqDemandConfirm) throws Exception {
        boolean flag = hqDemandConfirmService.saveHqDemandConfirm(hqDemandConfirm);
        //noinspection unchecked
        return ApiResult.result(flag);
    }

    /**
     * 修改后勤需求确认单
     */
    @PostMapping("/update")
//    @RequiresPermissions("hq:demand:confirm:update")
    @ApiOperation(value = "修改HqDemandConfirm对象", notes = "修改后勤需求确认单")     //不可加培训确认单状态
    public ApiResult<Boolean> updateHqDemandConfirm(@Valid @RequestBody HqDemandConfirm hqDemandConfirm) throws Exception {
        boolean flag = hqDemandConfirmService.updateHqDemandConfirm(hqDemandConfirm);
        //noinspection unchecked
        return ApiResult.result(flag);
    }

    /**
     * 删除后勤需求确认单
     */
    @PostMapping("/delete/{id}")
    @RequiresPermissions("hq:demand:confirm:delete")
    @ApiOperation(value = "删除HqDemandConfirm对象", notes = "删除后勤需求确认单")
    public ApiResult<Boolean> deleteHqDemandConfirm(@PathVariable("id") Long id) throws Exception {
        boolean flag = hqDemandConfirmService.deleteHqDemandConfirm(id);
        //noinspection unchecked
        return ApiResult.result(flag);
    }

    /**
     * 后勤需求确认单分页列表
     */
    @PostMapping("/pageList")
    //@RequiresPermissions("hq:demand:confirm:page")
    @ApiOperation(value = "获取HqDemandConfirm分页列表", notes = "后勤需求确认单分页列表")
    public ApiResult<Paging<HqDemandConfirmQueryVo>> getHqDemandConfirmPageList(@Valid @RequestBody HqDemandConfirmQueryParam hqDemandConfirmQueryParam) throws Exception {
        Paging<HqDemandConfirmQueryVo> paging = hqDemandConfirmService.getHqDemandConfirmPageList(hqDemandConfirmQueryParam);
        //noinspection unchecked
        return ApiResult.ok(paging);
    }

    /**
     * 场地使用列表
     */
    @PostMapping("/vuepageList")
    //@RequiresPermissions("hq:demand:confirm:page")
    @ApiOperation(value = "获取JwPtkScheduleCourseDetail列表", notes = "场地使用列表")
    public ApiResult<Paging<JwPtkScheduleCourseDetailByClassId>> getHqDemandConfirmVuepageList(@Valid @RequestBody HqDemandConfirmQueryParam hqDemandConfirmQueryParam) throws Exception {
        List<JwPtkScheduleCourseDetailByClassId> venueInfoPageList = hqDemandConfirmService.getVenueInfoPageList(hqDemandConfirmQueryParam);
        //noinspection unchecked
        Paging<JwPtkScheduleCourseDetailByClassId> jwPtkScheduleCourseDetailByClassIdPaging = new Paging<>(venueInfoPageList);
        return ApiResult.ok(jwPtkScheduleCourseDetailByClassIdPaging);
    }


    /**
     * 修改排调课信息备注
     */
    @PostMapping("/updatepdk")
    @ApiOperation(value = "修改HqDemandConfirm对象", notes = "修改排调课备注")
    public ApiResult<Boolean> updatejwPtkScheduleCourseDetail(@Valid @RequestBody HqJwPtkScheduleCourseDetailQueryParams hqJwPtkScheduleCourseDetailQueryParams) throws Exception {
        boolean b = hqDemandConfirmService.updateVenueInfoPageList(hqJwPtkScheduleCourseDetailQueryParams.getId(),hqJwPtkScheduleCourseDetailQueryParams.getRemark());
        return ApiResult.result(b);
    }


}

最后

以上就是单身红牛为你收集整理的调用api接口(在api中写自己需要的方法)的全部内容,希望文章能够帮你解决调用api接口(在api中写自己需要的方法)所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(88)

评论列表共有 0 条评论

立即
投稿
返回
顶部