添加用户类及部分接口信息

This commit is contained in:
muhua 2024-07-07 15:09:10 +08:00
parent 4b4cd29c68
commit b49abc36ff
7 changed files with 204 additions and 0 deletions

View File

@ -0,0 +1,57 @@
package com.example.takeawaysystemserver.controller;
import com.example.takeawaysystemserver.entity.User;
import com.example.takeawaysystemserver.service.userService.UserService;
import com.example.takeawaysystemserver.util.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.security.PublicKey;
/**
* @author Ethereal
* @date 2024/7/7
* @description
*/
@RestController
@Api(tags = "用户模块")
@RequestMapping("user")
public class UserController {
@Resource
private UserService userService;
@PostMapping("/register")
@ApiOperation(value = "注册")
public R<String> register(){
return userService.register();
}
@PostMapping("/login")
@ApiOperation(value = "登录")
public R<String> login(){
return userService.login();
}
@PostMapping("/logout")
@ApiOperation(value = "登出")
public R<String> logout(){
return userService.logout();
}
@PostMapping("/userinfo")
@ApiOperation(value = "获取用户信息")
public R<User> getUserInfo(){
return userService.getUserInfo();
}
@PostMapping("/update")
@ApiOperation(value = "修改用户信息")
public R<String> updateUser(){
return userService.updateUser();
}
}

View File

@ -0,0 +1,16 @@
package com.example.takeawaysystemserver.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author Ethereal
* @date 2024/7/7
* @description
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Business {
}

View File

@ -0,0 +1,16 @@
package com.example.takeawaysystemserver.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author Ethereal
* @date 2024/7/7
* @description
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Food {
}

View File

@ -0,0 +1,16 @@
package com.example.takeawaysystemserver.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author Ethereal
* @date 2024/7/7
* @description
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Order {
}

View File

@ -0,0 +1,17 @@
package com.example.takeawaysystemserver.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author Ethereal
* @date 2024/7/7
* @description
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class User {
}

View File

@ -0,0 +1,43 @@
package com.example.takeawaysystemserver.service.userService;
import com.example.takeawaysystemserver.entity.User;
import com.example.takeawaysystemserver.util.R;
/**
* @author Ethereal
* @date 2024/7/7
* @description
*/
public interface UserService {
/**
* 登录
* @return token
*/
R<String> login();
/**
* 注册
* @return 注册信息
*/
R<String> register();
/**
* 登出
* @return 返回登出成功信息
*/
R<String> logout();
/**
* 获取用户信息
* @return 用户信息
*/
R<User> getUserInfo();
/**
* 更新用户信息
* @return 更新成功与否
*/
R<String> updateUser();
}

View File

@ -0,0 +1,39 @@
package com.example.takeawaysystemserver.service.userService.impl;
import com.example.takeawaysystemserver.entity.User;
import com.example.takeawaysystemserver.service.userService.UserService;
import com.example.takeawaysystemserver.util.R;
import org.springframework.stereotype.Service;
/**
* @author Ethereal
* @date 2024/7/7
* @description
*/
@Service
public class UserServiceImpl implements UserService {
@Override
public R<String> login() {
return null;
}
@Override
public R<String> register() {
return null;
}
@Override
public R<String> logout() {
return null;
}
@Override
public R<User> getUserInfo() {
return null;
}
@Override
public R<String> updateUser() {
return null;
}
}