parent
d7eaad1cbf
commit
fe8565c2a2
@ -0,0 +1,38 @@
|
||||
package controller;
|
||||
|
||||
import cache.DataSet;
|
||||
import database.mssql.UsersEntity;
|
||||
import message.Message;
|
||||
import message.StateCode;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/recommend")
|
||||
public class AutoRecommendCtl {
|
||||
@Autowired
|
||||
private DataSet dataSet;
|
||||
|
||||
|
||||
@GetMapping
|
||||
public Message getRecommend(@RequestParam String username){
|
||||
Message message = new Message();
|
||||
ConcurrentHashMap<String, UsersEntity> userSet = dataSet.getUserMap();
|
||||
UsersEntity usersEntity = userSet.get(username);
|
||||
if(usersEntity == null){
|
||||
message.setMsg(username + "未找到")
|
||||
.setCode(StateCode.NOT_FOUND)
|
||||
.setData(null);
|
||||
}
|
||||
return message;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package server
|
||||
|
||||
import org.springframework.stereotype.Controller
|
||||
import org.springframework.web.bind.annotation.CrossOrigin
|
||||
import org.springframework.web.bind.annotation.GetMapping
|
||||
import org.springframework.web.bind.annotation.RequestMapping
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/pay")
|
||||
class Pages {
|
||||
@CrossOrigin(origins = ["*"])
|
||||
@GetMapping("/alipay/result")
|
||||
fun result (): String {
|
||||
return "pay"
|
||||
}
|
||||
}
|
||||
@ -1,11 +0,0 @@
|
||||
package database.mongo;
|
||||
|
||||
import org.springframework.data.mongodb.repository.MongoRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import java.util.ArrayList;
|
||||
|
||||
@Repository
|
||||
public interface CommentRepo extends MongoRepository<Comment,String> {
|
||||
ArrayList<Comment> findAll();
|
||||
ArrayList<Comment> findAllById(String id);
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package helper;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@Component
|
||||
public class UserService {
|
||||
public String joinTags(ArrayList<String> tags){
|
||||
StringBuilder builder = new StringBuilder(tags.get(0));
|
||||
for(int i = 1;i < tags.size();i++){
|
||||
builder.append("-").append(tags.indexOf(i));
|
||||
}
|
||||
return builder.toString();
|
||||
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue