团队冲刺4
一、前言
1.昨天完成了:
安卓界面的设计,也学习spring boot,Vue,安卓等等方面的知识
2.今天完成了:
学习spring boot,Vue,安卓等等方面的知识
3.遇到的困难
因为对这些知识的不熟练导致花费大量时间来实现我们项目的功能
二、冲刺进度
1.任务量:10天。
2.目前已经花的时间:3天。
还剩余的时间:7天
三、逻辑代码
写完用户的部分内容。
package com.medicalretrieval.pojo.user; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import javax.persistence.*; @Entity @Data @NoArgsConstructor @AllArgsConstructor public class User { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private long id; @Column(columnDefinition = "varchar(128) not null default '' ") private String account=""; @Column(columnDefinition = "varchar(128) not null default '' ") private String password=""; @Column(columnDefinition = "varchar(128) not null default '' ") private String email=""; @Column(columnDefinition = "int not null default '0'") private int sex = 0; @Column(columnDefinition = "varchar(128) not null default '' ") private String telephone=""; @Column(columnDefinition = "int not null default '0' ") private int permissionGroupId=0; @Column(columnDefinition = "varchar(128) not null default '' ") private String avatar="http://192.168.43.144:8080/avatar/default_avatar_man.png"; @Column(columnDefinition = "int not null default '0' ") private int disabled=0; }
package com.medicalretrieval.controller; import com.medicalretrieval.pojo.user.User; import com.medicalretrieval.service.UserService; import com.medicalretrieval.utils.Result; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; @RestController @RequestMapping("/user") public class UserController { @Autowired private UserService userService; @PostMapping("/") User addUser(@RequestBody User user){ if (user.getSex()==1){ user.setAvatar("http://192.168.43.144:8080/avatar/default_avatar_female.png"); } System.out.println(user); userService.save(user); System.out.println("添加成功:"+user); return user; } @DeleteMapping("/{id}") Object deleteUser(@PathVariable String id){ userService.deleteById(Long.parseLong(id)); return Result.success(); } @PutMapping("/") Object updateUser(@RequestBody User user){ userService.updatePasswordAndEmailAndTelephoneAndPermissionGroupIdAndAvatarAndDisabledById(user.getPassword(),user.getEmail(),user.getTelephone(), user.getPermissionGroupId(), user.getAvatar(), user.getDisabled(), user.getId()); System.out.println("修改成功:"+user); return Result.success(); } @GetMapping("/") Object queryUser(String account,String password){ User user = userService.findByAccountAndPassword(account,password); if (user==null){ return Result.fail("登录失败,用户名或密码错误"); } System.out.println("查询成功:"+user); return Result.success(user); } }