地质所 沉降监测网建设项目
zmk
2024-05-16 6cc8b13ee47303a907f8e57b018406c46d8928e4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package com.javaweb.app.controller.sys.service.impl;
 
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import com.javaweb.app.controller.sys.entity.AppUser;
import com.javaweb.app.controller.sys.mapper.UserMapper;
 
@Service("userService")
public class UserService
{
    @Autowired
    UserMapper userMapper;
 
    public AppUser findByUsername(String username)
    {
        AppUser appUser = new AppUser();
        appUser.setUsername(username);
        // return userMapper.selectOne(user);
        // 这里演示就直接返回了
        appUser.setPassword("123456");
        appUser.setId(1l);
        return appUser;
    }
 
    public AppUser findUserById(long userId)
    {
        //return userMapper.selectByPrimaryKey(userId);
        AppUser appUser = new AppUser();
        appUser.setUsername("test");
        // return userMapper.selectOne(user);
        // 这里演示就直接返回了
        appUser.setPassword("123456");
        appUser.setId(userId);
        return appUser;
    }
}