自动生成配置文件和mapper xml
parent
93dd731bbe
commit
e8fda05a6b
@ -1,33 +1,40 @@
|
|||||||
//package com.sztzjy.financial_bigdata.config.security;
|
package com.sztzjy.financial_bigdata.config.security;
|
||||||
//
|
|
||||||
//import com.sztzjy.financial_bigdata.entity.User;
|
import com.sztzjy.financial_bigdata.entity.StuUser;
|
||||||
//import com.sztzjy.financial_bigdata.service.IUserService;
|
import com.sztzjy.financial_bigdata.entity.StuUserExample;
|
||||||
//import io.jsonwebtoken.lang.Assert;
|
import com.sztzjy.financial_bigdata.mapper.StuUserMapper;
|
||||||
//import org.springframework.security.core.userdetails.UserDetails;
|
import io.jsonwebtoken.lang.Assert;
|
||||||
//import org.springframework.security.core.userdetails.UserDetailsService;
|
import org.springframework.security.core.userdetails.UserDetails;
|
||||||
//import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||||
//import org.springframework.stereotype.Service;
|
import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
||||||
//
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||||
//import javax.annotation.Resource;
|
import org.springframework.stereotype.Service;
|
||||||
//
|
|
||||||
//
|
import javax.annotation.Resource;
|
||||||
//@Service
|
import java.util.List;
|
||||||
//public class AuthenticationService implements UserDetailsService {
|
|
||||||
// @Resource
|
|
||||||
// private IUserService userService;
|
@Service
|
||||||
//
|
public class AuthenticationService implements UserDetailsService {
|
||||||
//
|
@Resource
|
||||||
// @Override
|
private StuUserMapper stuUserMapper;
|
||||||
// public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
|
|
||||||
// User user = userService.findByUsername(username);
|
|
||||||
// Assert.notNull(user, "用户不存在");
|
@Override
|
||||||
//
|
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
|
||||||
// JwtUser jwtUser = new JwtUser();
|
StuUserExample stuUserExample = new StuUserExample();
|
||||||
// jwtUser.setUsername(user.getUsername());
|
stuUserExample.createCriteria().andUsernameEqualTo(username);
|
||||||
// jwtUser.setPassword(user.getPassword());
|
List<StuUser> list = stuUserMapper.selectByExample(stuUserExample);
|
||||||
// jwtUser.setUserId(user.getUserid());
|
Assert.notNull(list, "用户不存在");
|
||||||
// jwtUser.setName(user.getName());
|
StuUser user = list.get(0);
|
||||||
// jwtUser.setRoleId(user.getRoleId());
|
com.sztzjy.financial_bigdata.config.security.JwtUser jwtUser = new com.sztzjy.financial_bigdata.config.security.JwtUser();
|
||||||
// return jwtUser;
|
jwtUser.setUsername(user.getUsername());
|
||||||
// }
|
jwtUser.setPassword(new BCryptPasswordEncoder().encode(user.getPassword())); //不加密会报错Encoded password does not look like BCrypt
|
||||||
//}
|
jwtUser.setUserId(user.getUserid());
|
||||||
|
jwtUser.setName(user.getName());
|
||||||
|
jwtUser.setRoleId(user.getRoleId());
|
||||||
|
jwtUser.setStudentId(user.getStudentId());
|
||||||
|
return jwtUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
@ -0,0 +1,61 @@
|
|||||||
|
package com.sztzjy.financial_bigdata.entity.tea_dto;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实训报告表
|
||||||
|
*
|
||||||
|
* @author xcj
|
||||||
|
* training_report
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class TrainingReportDto {
|
||||||
|
@ApiModelProperty("实训报告ID")
|
||||||
|
private String reportId;
|
||||||
|
|
||||||
|
@ApiModelProperty("章节ID")
|
||||||
|
private String chapterId;
|
||||||
|
|
||||||
|
@ApiModelProperty("章节名称")
|
||||||
|
private String chapterName;
|
||||||
|
|
||||||
|
@ApiModelProperty("用户ID")
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
@ApiModelProperty("姓名")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty("学号")
|
||||||
|
private String studentId;
|
||||||
|
|
||||||
|
@ApiModelProperty("班级")
|
||||||
|
private String className;
|
||||||
|
|
||||||
|
@ApiModelProperty("实训报告名称")
|
||||||
|
private String reportName;
|
||||||
|
|
||||||
|
@ApiModelProperty("实训报告上传时间")
|
||||||
|
private Date uploadTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("实训报告大小/单位MB")
|
||||||
|
private Integer reportSize;
|
||||||
|
|
||||||
|
@ApiModelProperty("教师评分")
|
||||||
|
private BigDecimal teacherScore;
|
||||||
|
|
||||||
|
@ApiModelProperty("文件地址")
|
||||||
|
private String filePath;
|
||||||
|
|
||||||
|
@ApiModelProperty("学校ID")
|
||||||
|
private String schoolId;
|
||||||
|
|
||||||
|
@ApiModelProperty("教师评语")
|
||||||
|
private String teacherComment;
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue