首页 > 其他分享 >1.24

1.24

时间:2024-01-26 18:26:23浏览次数:22  
标签:return String id Result userService public 1.24

今天实现Controller类

package com.example.controller;

import com.example.pojo.Application;
import com.example.pojo.Baoxiao;
import com.example.pojo.Result;
import com.example.service.UserService;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.rmi.server.RemoteRef;

@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;

    //登陆验证
    @GetMapping("/getByUser")
    public Result getByUser(String username, String password) {
        return Result.success(userService.getByUser(username, password));
    }

    @GetMapping("getName/{username}")
    public Result getName(@PathVariable("username") String username) {
        return Result.success(userService.getName(username));
    }

    @GetMapping("/count/{id}")
    public ResponseEntity<Integer> count(@PathVariable("id") String id) {
        int re = userService.count(id);
        return ResponseEntity.ok(re);
    }

    @PostMapping("/add1")
    public Result add1(@RequestBody Application application) {
        userService.add1(application);
        return Result.success(application);
    }

    @PostMapping("/update1")
    public Result update1(@RequestBody Application application) {
        userService.update1(application);
        return Result.success(application);
    }

    @GetMapping("/reasonable/{id}")
    public Result reasonable(@PathVariable("id") String id) {
        return Result.success(userService.reasonable(id));
    }

    @DeleteMapping("/delete/{id}")
    public Result delete(@PathVariable("id") String id) {
        userService.delete(id);
        return Result.success();
    }

    @PostMapping("/add2")
    public Result add2(@RequestBody Baoxiao baoxiao) {
        userService.add2(baoxiao);
        return Result.success(baoxiao);
    }

    @GetMapping("/pay1/{id}")
    public ResponseEntity<Integer> pay1(@PathVariable("id") String id) {
        int re = userService.pay1(id);
        return ResponseEntity.ok(re);
    }

    @GetMapping("/examine/{id}")
    public Result examine(@PathVariable("id") String id) {
        return Result.success(userService.examine(id));
    }

    @PostMapping("/update2")
    public Result update2(@RequestBody Baoxiao baoxiao) {
        userService.update2(baoxiao);
        return Result.success(baoxiao);
    }

    @GetMapping("/SelectApp/{id}")
    public Result selectApp(@PathVariable("id") String id) {
        return Result.success(userService.selectApp(id));
    }

    @GetMapping("/SelectBao/{id}")
    public Result selectBao(@PathVariable("id") String id) {
        return Result.success(userService.selectBao(id));
    }

    @GetMapping("/Select1/{id}")
    public Result select1(@PathVariable("id") String id) {
        return Result.success(userService.select1(id));
    }

    @GetMapping("/updateById/{id}/{state}")
    public Result updateById(@PathVariable("id") String id, @PathVariable("state") String state) {
        userService.updateById(id, state);
        return Result.success();
    }

    @GetMapping("/updateById2/{id}/{state}")
    public Result updateById2(@PathVariable("id") String id, @PathVariable("state") String state) {
        userService.updateById2(id, state);
        return Result.success();
    }
}

 

标签:return,String,id,Result,userService,public,1.24
From: https://www.cnblogs.com/zzqq1314/p/17990418

相关文章

  • 学习笔记-24.1.24
    switch(v.getId()){caseR.id.eye1:if(hide){hide=false;eye1.setImageResource(R.drawable.baseline_remove_red_eye_24);//可见样貌......
  • 1.24 两道树上问题的解法与思考
    内容过于简单,勿喷。1.1P6072Path(双log)选择两条简单路径,满足没有重合的点,且边权异或和之和最大。\(n\le10^5\)。我们可以把问题转化为选出一个\(u\),令在子树内选出两个点的异或和最大为\(f_u\),子树外为\(g_u\),那么我们需要求\(f_u+g_u\)的最大值。首先,通过DSUont......
  • 1.24总结
    packagecom.mediator;importcom.mediator.Annotations.CommandHandler;importcom.mediator.Annotations.EnableCommandHandler;importcom.mediator.Annotations.PipeLine;importcom.mediator.Mediator.IMediator;importcom.mediator.Mediator.impl.Mediator;impor......
  • 1.24学习进度
    1.RDD的创建通过并行化集合创建(本地对象转分布式RDD)读取外部数据源(读取文件):textfileapi(可以读取本地数据)2.算子是什么算子:分布式集合对象上的api方法/函数:本地对象的api3.算子的分类   Transformation:转换算子(返回值是rdd)特性:这类算子时lazy、懒加载的,如果没有action算子......
  • 【云原生】kubernetes 1.24 安装教程
    博主介绍:–我是了凡微信公众号【了凡银河系】期待你的关注。未来大家一起加油啊~前言下面记录kubernets1.24安装记录。主要使用calico作为网络插件、kongingress作为路由转发、nginx作为四层代理。如果安装过程中遇到问题,及时沟通,如果不能及时回应,可以关注【了凡银河系】微......
  • OpenEuler22.03源码编译安装nginx1.24.0
    一、环境说明操作系统版本:OpenEuler22.03SP2LTSNginx版本:1.24.0安装位置:/app/nginxSelinux配置:关闭或设置为permissive二、Nginx安装#安装必要依赖dnf-yinstalltargccmakepcrepcre-develzlibzlib-developensslopenssl-devel#创建nginx安装文件夹mkdir/......
  • 11.24
    static关键字:静态变量:使用static修饰的成员变量叫做静态变量,静态变量和非静态变量的区别是:静态变量被所有的对象所共享,在内存中只有一个副本,它当且仅当在类初次加载时会被初始化。而非静态变量是对象所拥有的,在创建对象的时候被初始化,存在多个副本,各个对象拥有的副本互不影响。s......
  • 11.24
    <%@pagecontentType="text/html;charset=UTF-8"language="java"%><%@pageimport="java.sql.*"%><%@pageimport="javax.naming.*"%><%@pageimport="javax.*"%><html><body&g......
  • 11.24
    今天实现ROOT层root.html<!DOCTYPEhtml><htmllang="en"><head><metacharset="UTF-8"><title>管理员页面</title><style>.form{width:600px;margin:0auto......
  • 11.24
    4.输入n(n<=20)名职工的姓名(姓名的长度小于10)及计算机水平考试成绩,输出及格人数和及格的职工姓名。(期末真题)【设计要求】(1)定义职工结构体类型structStaff(2)定义输入函数voidinput(structStaffwork[],intn)完成职工信息的输入,各输入信息间以空格为间隔。(3)定义输出函数......