Commit 2ef8ed9c by wangli

新增user接口

1 parent ffcc2489
package com.alibaba.cloud.integration.order.controller;
import com.alibaba.cloud.integration.common.Result;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/pea-order")
public class UserController {
@PostMapping("/user/login")
public Result<?> userLogin(@RequestBody String account, @RequestBody String password) {
return null;
}
@GetMapping("/user/userInfo")
public Result<?> getUserInfo(@RequestBody String userToken, @RequestBody boolean needTeamInfo) {
return null;
}
}
package com.alibaba.cloud.integration.order.service;
import com.alibaba.cloud.integration.common.Result;
public interface UserService {
Result<?> userLogin(String account, String password);
Result<?> getUserInfo(String token, boolean needTeamInfo);
}
package com.alibaba.cloud.integration.order.service.impl;
import com.alibaba.cloud.integration.common.Result;
import com.alibaba.cloud.integration.order.service.UserService;
import com.sun.xml.bind.v2.TODO;
import org.springframework.stereotype.Service;
import java.util.HashMap;
@Service
public class UserServiceImpl implements UserService {
@Override
public Result<?> userLogin(String account, String password) {
HashMap<String, String> map = new HashMap<>();
map.put("token", "88d89f379a634867b1c7274a8b86bba6"); //TODO
return Result.success(map);
}
@Override
public Result<?> getUserInfo(String token, boolean needTeamInfo) {
HashMap<String, String> map = new HashMap<>();
map.put("account", "ID9192");
map.put("nickname", "测试用户");
map.put("clusterId", "csuzhou");
map.put("branchId", "bsuzhou");
map.put("groupId", "gsuzhou");
map.put("levelType", "branch");
map.put("levelId", "bsuzhou");
return Result.success(map);
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!