首页>代码>基于SpringBoot+Vue实现的在线考试系统>/OnlineExamSystem/OnlineExamSystemApi/src/main/java/com/rabbiter/oes/controller/FillQuestionController.java
package com.rabbiter.oes.controller;

import com.rabbiter.oes.entity.ApiResult;
import com.rabbiter.oes.entity.FillQuestion;
import com.rabbiter.oes.serviceimpl.FillQuestionServiceImpl;
import com.rabbiter.oes.util.ApiResultHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class FillQuestionController {

    @Autowired
    private FillQuestionServiceImpl fillQuestionService;

    @PostMapping("/fillQuestion")
    public ApiResult add(@RequestBody FillQuestion fillQuestion) {
        int res = fillQuestionService.add(fillQuestion);
        if (res != 0) {
            return ApiResultHandler.buildApiResult(200,"添加成功",res);
        }
        return ApiResultHandler.buildApiResult(400,"添加失败",res);
    }

    @GetMapping("/fillQuestionId")
    public ApiResult findOnlyQuestionId() {
        FillQuestion res = fillQuestionService.findOnlyQuestionId();
        return ApiResultHandler.buildApiResult(200,"查询成功",res);
    }

    @PostMapping("/editFillQuestion")
    public ApiResult edit(@RequestBody FillQuestion fillQuestion) {
        int res = fillQuestionService.edit(fillQuestion);
        if (res != 0) {
            return ApiResultHandler.buildApiResult(200,"修改成功",res);
        }
        return ApiResultHandler.buildApiResult(400,"修改失败",res);
    }
}
最近下载更多
dapeng0011  LV13 4月6日
zolscy  LV12 3月24日
2206371875  LV7 3月14日
3263394665  LV9 3月10日
wanglinddad  LV55 3月7日
qqttuu  LV3 3月6日
gnnhka  LV10 3月4日
haozhilang  LV8 2月27日
Boss绝  LV9 2月26日
最近浏览更多
chirsbey2 5月10日
暂无贡献等级
kenhomeliu  LV29 4月30日
JiangYing009  LV8 4月27日
1230123  LV1 4月21日
qianhui1  LV3 4月18日
做自己的太阳  LV11 4月17日
dhcpsl  LV2 4月10日
wmxhahah  LV7 4月8日
dapeng0011  LV13 4月6日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友