Compare commits

..

30 Commits

Author SHA1 Message Date
9ae4a83573 演示项目 2023-12-12 17:31:48 +08:00
9e3f0c440a 反馈历史 2023-11-24 09:31:30 +08:00
20b77a119a 反馈导入导出 2023-11-24 00:55:05 +08:00
da3fb87975 用户物品的查询改成gorse 2023-11-24 00:26:02 +08:00
eeb87693d4 用户物品导出 2023-11-23 18:16:39 +08:00
a790a20f80 用户物品导出 2023-11-23 17:26:00 +08:00
55dd565e92 用户物品导出 2023-11-14 11:36:58 +08:00
66222d5d93 用户导入,物品导入 2023-11-14 10:48:48 +08:00
4eb096907b 用户导入,物品导入 2023-11-14 10:16:40 +08:00
a038772795 用户导入,物品导入 2023-11-14 10:16:19 +08:00
dc1b11155a 增加新功能,用户导入,未完成,需要对接导入接口 2023-11-08 16:52:38 +08:00
1025859868@qq.com
bbd24b24ae 改样式 2023-10-09 18:19:00 +08:00
8cd092c4fd 新增关联页面 2023-07-13 10:12:31 +08:00
ee0013fc18 12 2023-07-12 09:01:18 +08:00
68ed8e92e7 Merge branch 'master' of http://nas.zhengjl.com:10880/wan/recom-gorse 2023-06-15 11:13:22 +08:00
c655b8300a 123 2023-06-15 11:13:15 +08:00
2019e15b7a 添加相似和推荐功能 2023-06-14 19:10:31 +08:00
c1438af1e4 Merge branch 'master' of http://nas.zhengjl.com:10880/wan/recom-gorse 2023-05-29 17:52:21 +08:00
dfd0ba6ffa 123 2023-05-29 17:52:15 +08:00
41e3f0dafa 智能推荐 2023-05-29 16:13:18 +08:00
0df46cc022 Merge branch 'master' of http://nas.zhengjl.com:10880/wan/recom-gorse 2023-05-29 15:03:08 +08:00
3ef1ea7a93 修bug 2023-05-29 15:03:03 +08:00
5cfa136576 智能推荐 2023-05-23 17:29:42 +08:00
0bddfd3e0e 123 2023-05-23 15:22:36 +08:00
b11bf94612 Merge branch 'master' of http://nas.zhengjl.com:10880/wan/recom-gorse 2023-05-23 15:11:33 +08:00
024738565c 提交 2023-05-23 15:11:28 +08:00
c53990299a 条目和反馈类型管理菜单新添 2023-05-12 16:08:38 +08:00
d0a0a59ea3 123 2023-05-12 09:17:22 +08:00
23ef8577bb Merge branch 'master' of http://nas.zhengjl.com:10880/wan/recom-gorse 2023-05-12 09:14:23 +08:00
2b5991ea75 推荐系统 2023-05-12 09:14:17 +08:00
190 changed files with 25911 additions and 371 deletions

3
api/path/to/file Normal file
View File

@@ -0,0 +1,3 @@
user_id,comment,labels
wxxwjef,This is a way,[]
hahah,No matter,[]

View File

@@ -311,6 +311,19 @@
<artifactId>client</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
</dependency>
</dependencies>

View File

@@ -0,0 +1,39 @@
package com.wx.application.adapter.controller;
import com.wx.application.adapter.dto.qo.GorseQ;
import com.wx.application.base.BaseController;
import com.wx.application.base.ResponseData;
import com.wx.application.core.service.EntrysService;
import com.wx.application.core.service.RiskUserService;
import com.wx.application.gorse4j.GorseService;
import com.wx.application.gorse4j.Item;
import com.wx.application.nebula.graph.query.NebulaModel;
import com.wx.application.nebula.graph.query.NebulaNode;
import com.wx.application.nebula.graph.service.ImportGraphService;
import com.wx.application.nebula.graph.service.NebulaOperateService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Slf4j
@RequestMapping("/bulk")
@Controller("bulkController")
public class BulkController extends BaseController {
@Autowired
GorseService gorseService;
@GetMapping(value = "/get_bulk/{type}")
public String getBulkUserOrItem(@PathVariable("type") String type) throws Exception {
return gorseService.getBulkUserOrItem(type);
}
}

View File

@@ -0,0 +1,174 @@
package com.wx.application.adapter.controller;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.alibaba.fastjson.JSONObject;
import com.wx.application.gorse4j.*;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.wx.application.adapter.dto.qo.GorseQ;
import com.wx.application.base.BaseController;
import com.wx.application.base.ResponseData;
import com.wx.application.core.service.EntrysService;
import com.wx.application.core.service.RiskUserService;
import com.wx.application.nebula.graph.query.NebulaModel;
import com.wx.application.nebula.graph.query.NebulaNode;
import com.wx.application.nebula.graph.service.ImportGraphService;
import com.wx.application.nebula.graph.service.NebulaOperateService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.multipart.MultipartFile;
@Slf4j
@RequestMapping("/gorse")
@RestController("gorseController")
public class GorseController extends BaseController {
@Autowired
GorseService gorseService;
@Autowired
NebulaOperateService nebulaOperateService;
@Autowired
ImportGraphService importGraphService;
/**
* 推荐根据userId
*
* @param gQo
* @return
* @throws Exception
*/
@PostMapping(value = "/recommend_by_userid")
public ResponseData recommendByUserId(@RequestBody GorseQ gQo) throws Exception {
return success(gorseService.getRecommend(gQo.getUserId()));
}
/**
* 根据列表推荐
*
* @param gQo
* @return
* @throws Exception
*/
@PostMapping(value = "/popular_by_category")
public ResponseData popularByCategory(@RequestBody GorseQ gQo) throws Exception {
List<Item> res = gorseService.getPopular(gQo.getCategory());
return success(res);
}
@PostMapping(value = "/ipt")
public ResponseData ipt() throws Exception {
importGraphService.iptUser();
importGraphService.iptentrys();
return success();
}
@PostMapping(value = "/delete_user/{userId}")
public ResponseData deleteUser(@PathVariable("userId") String userId) throws Exception {
return success(gorseService.deleteUser(userId));
}
@GetMapping(value = "/get_item/{itemId}")
public ResponseData getItem(@PathVariable("itemId") String itemId) throws Exception {
return success(gorseService.getItem(itemId));
}
@GetMapping(value = "/get_user/{userId}")
public ResponseData getUser(@PathVariable("userId") String userId) throws Exception {
return success(gorseService.getUser(userId));
}
@PostMapping(value = "/delete_item/{itemId}")
public ResponseData deleteItem(@PathVariable("itemId") String itemId) throws Exception {
return success(gorseService.deleteItem(itemId));
}
/**
* 推荐根据知识图谱
*
* @param gQo
* @return
* @throws Exception
*/
@PostMapping(value = "/recommend_by_userid_with_graph")
public ResponseData recommendByUserIdWithGraph(@RequestBody GorseQ gQo) throws Exception {
NebulaModel nebulaModel = nebulaOperateService.findOnePathById("", gQo.getUserId());
List<NebulaNode> nodes = nebulaModel.getNodes();
if (nodes != null && nodes.size() > 0) {
nodes.get(0).getVid();
}
return success(gorseService.getRecommend(gQo.getUserId()));
}
@PostMapping(value = "/get_similar_user")
public ResponseData getSimilarUser(@RequestBody GorseQ gQo) throws Exception {
return success(gorseService.getSimilarUser(gQo.getUserId()));
}
@PostMapping(value = "/get_similar_item")
public ResponseData getSimilarItem(@RequestBody GorseQ gQo) throws Exception {
return success(gorseService.getSimilarItem(gQo.getItemId(), gQo.getCategory(), gQo.getN()));
}
@PostMapping(value = "/get_recommend_by_user")
public ResponseData getRecommendByUser(@RequestBody GorseQ gQo) throws Exception {
return success(gorseService.getRecommendByUser(gQo.getUserId(), gQo.getRecommendation(), gQo.getCategory(), gQo.getN()));
}
@GetMapping(value = "/get_feedback_list/{userId}/{type}")
public ResponseData getFeedbackList(@PathVariable("userId") String userId, @PathVariable("type") String type) throws Exception {
return success(gorseService.listFeedback(userId, type));
}
@PostMapping(value = "/insert_feedback/{type}/{userId}/{itemId}")
public ResponseData insertFeedback(@PathVariable("userId") String userId, @PathVariable("type") String type,
@PathVariable("itemId") String itemId) throws Exception {
List<Feedback> list = new ArrayList<>();
Feedback fb = new Feedback();
fb.init(userId, itemId, type);
list.add(fb);
return success(gorseService.insertFeedback(list));
}
@PutMapping(value = "/bulk/{type}")
public ResponseData bulkUserOrItem(@RequestParam Map<String, String> data, @RequestParam("file") MultipartFile file, @PathVariable("type") String type) throws Exception {
return success(gorseService.bulkUserOrItem(data, file, type));
}
@GetMapping(value = "/get_bulk/{type}")
public String getBulkUserOrItem(@PathVariable("type") String type) {
return gorseService.getBulkUserOrItem(type);
}
@GetMapping(value = "/query_users")
public ResponseData queryUsers(@RequestParam("cursor") String cursor) throws Exception {
return success(gorseService.getUserPageByCursor(cursor));
}
@GetMapping(value = "/query_user/{id}")
public ResponseData queryUser(@PathVariable("id") String id) throws Exception {
return success(gorseService.getUserById(id));
}
@GetMapping(value = "/query_items")
public ResponseData queryItems(@RequestParam("cursor") String cursor) throws Exception {
return success(gorseService.getItemPageByCursor(cursor));
}
@GetMapping(value = "/query_item/{id}")
public ResponseData queryItem(@PathVariable("id") String id) throws Exception {
return success(gorseService.getItemById(id));
}
}

View File

@@ -10,8 +10,15 @@ import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.api.R;
import com.wx.application.core.mapper.RiskUserMapper;
import com.wx.application.gorse4j.GorseService;
import com.wx.application.gorse4j.User;
import org.apache.commons.lang3.StringUtils;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
//import org.redisson.api.RedissonClient;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@@ -40,11 +47,14 @@ import lombok.extern.slf4j.Slf4j;
@RestController("loginController")
public class LoginController extends BaseController {
@Autowired
RiskUserService riskUserService;
/*@Autowired
RedissonClient redissonClient;*/
@Autowired
RiskUserService riskUserService;
@Autowired
RiskUserMapper userMapper;
@Autowired
GorseService gorseService;
@Autowired
private Kaptcha kaptcha;
@@ -72,68 +82,75 @@ public class LoginController extends BaseController {
kaptcha.render();
}
/**
* 登录
*/
@PostMapping(value = "/user")
public ResponseData login(@RequestBody RiskUserQ loginQo) throws Exception {
// if(StringUtils.isBlank(loginQo.getCode())) {
// Map<String,String> data = new HashMap<>();
// data.put("msg", "验证码不能为空");
// return error(ErrorCodeEnum.USER_NOT_EXIST,data);
// }
//
// try {
// kaptcha.validate(loginQo.getCode());
// } catch (Exception e) {
// Map<String,String> data = new HashMap<>();
// data.put("msg", "验证码错误");
// return error(ErrorCodeEnum.USER_NOT_EXIST,data);
// }
/*if(StringUtils.isBlank(loginQo.getCode())) {
Map<String,String> data = new HashMap<>();
data.put("msg", "验证码不能为空");
return error(ErrorCodeEnum.USER_NOT_EXIST,data);
}
try {
kaptcha.validate(loginQo.getCode());
} catch (Exception e) {
Map<String,String> data = new HashMap<>();
data.put("msg", "验证码错误");
return error(ErrorCodeEnum.USER_NOT_EXIST,data);
}*/
/**
* 将密码改成md5加密查询
*/
Map<String,Object> mQ = new HashMap<>();
mQ.put("EQS_username", loginQo.getUsername());
mQ.put("EQS_password", MD5Util.MD5(loginQo.getPassword()));
mQ.put("EQS_type", loginQo.getType());
RiskUser riskUser = riskUserService.queryUnique(mQ);
if(riskUser != null) {
String token = JwtUtils.generateJwtToken(riskUser.getId(), CONSTANT.LOGIN_TYPE_ADMIN, riskUser);
RiskUser _riskUser = new RiskUser();
_riskUser.setRealname(riskUser.getRealname());
_riskUser.setUsername(riskUser.getUsername());
return success(ImmutableMap.<String, Object>builder()
.put("Authorization",token)
.put("user", _riskUser)
.build());
}
Map<String,String> data = new HashMap<>();
data.put("msg", "用户名密码错误");
return error(ErrorCodeEnum.USER_NOT_EXIST,data);
/**
* 登录
*/
@PostMapping(value = "/user")
public ResponseData login(@RequestBody RiskUserQ loginQo) throws Exception {
/**
* 将密码改成md5加密查询
*/
Map<String, Object> mQ = new HashMap<>();
mQ.put("EQS_username", loginQo.getUsername());
mQ.put("EQS_password", MD5Util.MD5(loginQo.getPassword()));
mQ.put("EQS_type", loginQo.getType());
RiskUser riskUser = riskUserService.queryUnique(mQ);
if (riskUser != null) {
String token = JwtUtils.generateJwtToken(riskUser.getId(), CONSTANT.LOGIN_TYPE_ADMIN, riskUser);
RiskUser _riskUser = new RiskUser();
_riskUser.setRealname(riskUser.getUsername());
_riskUser.setUsername(riskUser.getUsername());
return success(ImmutableMap.<String, Object>builder()
.put("Authorization", token)
.put("user", _riskUser)
.build());
}
Map<String, String> data = new HashMap<>();
data.put("msg", "用户名密码错误");
return error(ErrorCodeEnum.USER_NOT_EXIST, data);
}
/**
* 注册
*/
@PostMapping(value = "/register")
public ResponseData register(@RequestBody RiskUserQ registerQ) throws Exception {
Map<String, String> data = new HashMap<>();
if (StringUtils.isEmpty(registerQ.getUsername()) || StringUtils.isEmpty(registerQ.getPassword())) {
data.put("msg", "用户名密码不能为空");
return error(ErrorCodeEnum.PARAM_ERROR, data);
}
int blankUserCount = userMapper.selectCount(new QueryWrapper<RiskUser>().lambda().eq(RiskUser::getUsername, registerQ.getUsername()));
if (blankUserCount > 0) {
data.put("msg", "用户名已存在");
return error(ErrorCodeEnum.MOBILE_USED, data);
}
/**
* 将密码改成md5加密
*/
RiskUser nowUser = new RiskUser();
nowUser.setUsername(registerQ.getUsername());
nowUser.setPassword(MD5Util.MD5(registerQ.getPassword()));
nowUser.setType(registerQ.getType());
userMapper.insert(nowUser);
// User user = new User(registerQ.getUsername(), null);
// gorseService.insertUser(user);
return success();
}
/**
* 解密用户敏感数据获取用户信息
*

View File

@@ -0,0 +1,19 @@
package com.wx.application.adapter.dto.qo;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper=false)
public class GorseQ {
private String userId;
private String itemId;
private String category;
private Integer n;
private String recommendation;
}

View File

@@ -0,0 +1,261 @@
package com.wx.application.core.controller;
import org.springframework.web.bind.annotation.*;
import com.wx.application.base.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import com.wx.application.core.service.CategoryService;
import com.wx.application.core.entity.Category;
import com.wx.application.base.ResponseData;
import java.util.Map;
import java.io.Serializable;
/**
* @description : Category 默认控制器,仅供生成器使用
* ---------------------------------
* @since 2023-05-23
*/
/*@Slf4j*/
@RestController("coreCategoryController")
@RequestMapping("//category")
public class CategoryController extends BaseController {
@Autowired
private CategoryService categoryService;
/**
* 定义一些通用的错误信息,供其他 api引用
* @apiDefine DefaultException
* @apiError {String} code 错误码
* @apiError {String} msg 错误描述
* @apiError {String} requestId 请求id标识
*
* @apiErrorExample Error-Response:
* HTTP/1.1 200
* {
* "code": "UNAUTHORIZED",
* "msg": "未授权,请先登录",
* "requestId": "163e2f67-5306-4b10-bcbe-a1579d589446"
* }
*
*/
/**
* 定义标准对象请求的结构体,供api引用
* @apiDefine CategoryReq
* @apiParam {String} name
*/
/**
* 定义标准对象返回的结构体,供api引用
* @apiDefine CategoryResp
* @apiSuccess {String} name
*/
/**
* 定义标准头部,供api引用
* @apiDefine CategoryHeader
* @apiHeader {String} Authorization 用户授权token
* @apiHeaderExample {json} Header-Example:
* {
* "Authorization": "Bearer 1eyJhbGciOiJIUzI1NiJ9....tzNK43MPVQWYYhDwihCAZa88zXzar7KLdgiBBDuUpBM",
* }
*/
/**
*
* @api {post} //category/query_unique 通过条件查询对象
* @apiName 通过条件查询对象
* @apiGroup Category
*
* @apiUse CategoryHeader
* @apiUse CategoryResp
* @apiSuccessExample Success-Response:
* HTTP/1.1 200 OK
* {
* "data": {
"name": null,
* },
* "code": "SUCCESS",
* "msg": "请求成功",
* "requestId": "163e2f67-5306-4b10-bcbe-a1579d589446"
* }
*
* @apiUse DefaultException
*
* @description : 通过条件查询对象
* 仅查询第一条
* ---------------------------------
* @author : zj
* @since : Create in 2023-05-23
*/
@PostMapping(value = "/query_unique")
public ResponseData queryUnique(@RequestBody Map categoryQ) {
return success(categoryService.queryUnique(categoryQ));
}
/**
*
* @api {post} //category/query_pages 通过条件分页查询列表
* @apiName 通过条件分页查询列表
* @apiGroup Category
*
* @apiUse CategoryHeader
* @apiUse CategoryResp
* @apiSuccess {Long} total 总数
* @apiSuccess {Long} size 分页大小
* @apiSuccess {Long} current 当前页
* @apiSuccess {Long} orders 排序
* @apiSuccess {Long} pages 总页数
* @apiSuccessExample Success-Response:
* HTTP/1.1 200 OK
* {
* "data": {
* "records": [{
"name": null, * }],
* "total": 1,
* "size": 10,
* "current": 1,
* "orders": [],
* "searchCount": true,
* "pages": 1
* "code": "SUCCESS",
* "msg": "请求成功",
* "requestId": "163e2f67-5306-4b10-bcbe-a1579d589446"
* }
*
* @apiUse DefaultException
*
* @description : 通过条件分页查询列表
* 默认第一页 分页长度为10
* ---------------------------------
* @author : zj
* @since : Create in 2023-05-23
*/
@PostMapping(value = "/query_pages")
public ResponseData queryPages(@RequestBody Map categoryQ) {
return success(categoryService.queryPage(categoryQ));
}
/**
*
* @api {post} //category/query_list 通过条件查询列表
* @apiName 通过条件查询列表
* @apiGroup Category
*
* @apiUse CategoryHeader
* @apiUse CategoryResp
* @apiSuccessExample Success-Response:
* HTTP/1.1 200 OK
* {
* "data": [{
"name": null,
* }],
* "code": "SUCCESS",
* "msg": "请求成功",
* "requestId": "163e2f67-5306-4b10-bcbe-a1579d589446"
* }
*
* @apiUse DefaultException
*
* @description : 通过条件查询列表
* 不分页直接返回list
* ---------------------------------
* @author : zj
* @since : Create in 2023-05-23
*/
@PostMapping(value = "/query_list")
public ResponseData queryList(@RequestBody Map categoryQ) {
return success(categoryService.queryList(categoryQ));
}
/**
*
* @api {post} //category/remove/:id 通过id删除单个记录
* @apiName 通过id删除单个记录
* @apiGroup Category
*
* @apiUse CategoryHeader
* @apiParam {PK} id 记录主键
* @apiSuccessExample Success-Response:
* HTTP/1.1 200 OK
* {
* "data": true,
* "code": "SUCCESS",
* "msg": "请求成功",
* "requestId": "163e2f67-5306-4b10-bcbe-a1579d589446"
* }
*
* @apiUse DefaultException
*
* @description : 通过id删除单个记录
* ---------------------------------
* @author : zj
* @since : Create in 2023-05-23
*/
@PostMapping(value = "/remove/{id}")
public ResponseData remove(@PathVariable("id") Serializable id) {
return success(categoryService.remove(id));
}
/**
*
* @api {post} //category/modify 通过id更新单个记录
* @apiName 通过id更新单个记录
* @apiGroup Category
*
* @apiUse CategoryHeader
* @apiParam {PK} id 记录主键
* @apiUse CategoryReq
* @apiSuccessExample Success-Response:
* HTTP/1.1 200 OK
* {
* "data": true,
* "code": "SUCCESS",
* "msg": "请求成功",
* "requestId": "163e2f67-5306-4b10-bcbe-a1579d589446"
* }
*
* @apiUse DefaultException
*
* @description : 通过id更新单个记录
* ---------------------------------
* @author : zj
* @since : Create in 2023-05-23
*/
@PostMapping(value = "/modify")
public ResponseData modify(@RequestBody Category category) {
return success(categoryService.modify(category));
}
/**
*
* @api {post} //category/create 新增
* @apiName 新增
* @apiGroup Category
*
* @apiUse CategoryHeader
* @apiUse CategoryReq
* @apiSuccessExample Success-Response:
* HTTP/1.1 200 OK
* {
* "data": true,
* "code": "SUCCESS",
* "msg": "请求成功",
* "requestId": "163e2f67-5306-4b10-bcbe-a1579d589446"
* }
*
* @apiUse DefaultException
*
* @description : 新增
* ---------------------------------
* @author : zj
* @since : Create in 2023-05-23
*/
@PostMapping(value = "/create")
public ResponseData create(@RequestBody Category category) {
return success(categoryService.create(category));
}
}

View File

@@ -0,0 +1,289 @@
package com.wx.application.core.controller;
import org.springframework.web.bind.annotation.*;
import com.wx.application.base.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import com.wx.application.core.service.EntrysService;
import com.wx.application.core.entity.Entrys;
import com.wx.application.base.ResponseData;
import java.util.Map;
import java.io.Serializable;
/**
* @description : Entrys 默认控制器,仅供生成器使用
* ---------------------------------
* @since 2023-05-12
*/
/*@Slf4j*/
@RestController("coreEntrysController")
@RequestMapping("/entrys")
public class EntrysController extends BaseController {
@Autowired
private EntrysService entrysService;
/**
* 定义一些通用的错误信息,供其他 api引用
* @apiDefine DefaultException
* @apiError {String} code 错误码
* @apiError {String} msg 错误描述
* @apiError {String} requestId 请求id标识
*
* @apiErrorExample Error-Response:
* HTTP/1.1 200
* {
* "code": "UNAUTHORIZED",
* "msg": "未授权,请先登录",
* "requestId": "163e2f67-5306-4b10-bcbe-a1579d589446"
* }
*
*/
/**
* 定义标准对象请求的结构体,供api引用
* @apiDefine EntrysReq
* @apiParam {String} fid
* @apiParam {Boolean} isHidden
* @apiParam {String} categories
* @apiParam {String} labels
* @apiParam {String} description
*/
/**
* 定义标准对象返回的结构体,供api引用
* @apiDefine EntrysResp
* @apiSuccess {String} fid
* @apiSuccess {Boolean} isHidden
* @apiSuccess {String} categories
* @apiSuccess {String} labels
* @apiSuccess {String} description
*/
/**
* 定义标准头部,供api引用
* @apiDefine EntrysHeader
* @apiHeader {String} Authorization 用户授权token
* @apiHeaderExample {json} Header-Example:
* {
* "Authorization": "Bearer 1eyJhbGciOiJIUzI1NiJ9....tzNK43MPVQWYYhDwihCAZa88zXzar7KLdgiBBDuUpBM",
* }
*/
/**
*
* @api {post} //entrys/query_unique 通过条件查询对象
* @apiName 通过条件查询对象
* @apiGroup Entrys
*
* @apiUse EntrysHeader
* @apiUse EntrysResp
* @apiSuccessExample Success-Response:
* HTTP/1.1 200 OK
* {
* "data": {
"fid": null,
"isHidden": null,
"categories": null,
"labels": null,
"description": null,
* },
* "code": "SUCCESS",
* "msg": "请求成功",
* "requestId": "163e2f67-5306-4b10-bcbe-a1579d589446"
* }
*
* @apiUse DefaultException
*
* @description : 通过条件查询对象
* 仅查询第一条
* ---------------------------------
* @author : zj
* @since : Create in 2023-05-12
*/
@PostMapping(value = "/query_unique")
public ResponseData queryUnique(@RequestBody Map entrysQ) {
return success(entrysService.queryUnique(entrysQ));
}
/**
*
* @api {post} //entrys/query_pages 通过条件分页查询列表
* @apiName 通过条件分页查询列表
* @apiGroup Entrys
*
* @apiUse EntrysHeader
* @apiUse EntrysResp
* @apiSuccess {Long} total 总数
* @apiSuccess {Long} size 分页大小
* @apiSuccess {Long} current 当前页
* @apiSuccess {Long} orders 排序
* @apiSuccess {Long} pages 总页数
* @apiSuccessExample Success-Response:
* HTTP/1.1 200 OK
* {
* "data": {
* "records": [{
"fid": null,
"isHidden": null,
"categories": null,
"labels": null,
"description": null, * }],
* "total": 1,
* "size": 10,
* "current": 1,
* "orders": [],
* "searchCount": true,
* "pages": 1
* "code": "SUCCESS",
* "msg": "请求成功",
* "requestId": "163e2f67-5306-4b10-bcbe-a1579d589446"
* }
*
* @apiUse DefaultException
*
* @description : 通过条件分页查询列表
* 默认第一页 分页长度为10
* ---------------------------------
* @author : zj
* @since : Create in 2023-05-12
*/
@PostMapping(value = "/query_pages")
public ResponseData queryPages(@RequestBody Map entrysQ) {
return success(entrysService.queryPage(entrysQ));
}
/**
*
* @api {post} //entrys/query_list 通过条件查询列表
* @apiName 通过条件查询列表
* @apiGroup Entrys
*
* @apiUse EntrysHeader
* @apiUse EntrysResp
* @apiSuccessExample Success-Response:
* HTTP/1.1 200 OK
* {
* "data": [{
"fid": null,
"isHidden": null,
"categories": null,
"labels": null,
"description": null,
* }],
* "code": "SUCCESS",
* "msg": "请求成功",
* "requestId": "163e2f67-5306-4b10-bcbe-a1579d589446"
* }
*
* @apiUse DefaultException
*
* @description : 通过条件查询列表
* 不分页直接返回list
* ---------------------------------
* @author : zj
* @since : Create in 2023-05-12
*/
@PostMapping(value = "/query_list")
public ResponseData queryList(@RequestBody Map entrysQ) {
return success(entrysService.queryList(entrysQ));
}
/**
*
* @api {post} //entrys/remove/:id 通过id删除单个记录
* @apiName 通过id删除单个记录
* @apiGroup Entrys
*
* @apiUse EntrysHeader
* @apiParam {PK} id 记录主键
* @apiSuccessExample Success-Response:
* HTTP/1.1 200 OK
* {
* "data": true,
* "code": "SUCCESS",
* "msg": "请求成功",
* "requestId": "163e2f67-5306-4b10-bcbe-a1579d589446"
* }
*
* @apiUse DefaultException
*
* @description : 通过id删除单个记录
* ---------------------------------
* @author : zj
* @since : Create in 2023-05-12
*/
@PostMapping(value = "/remove/{id}")
public ResponseData remove(@PathVariable("id") Serializable id) {
return success(entrysService.remove(id));
}
/**
*
* @api {post} //entrys/modify 通过id更新单个记录
* @apiName 通过id更新单个记录
* @apiGroup Entrys
*
* @apiUse EntrysHeader
* @apiParam {PK} id 记录主键
* @apiUse EntrysReq
* @apiSuccessExample Success-Response:
* HTTP/1.1 200 OK
* {
* "data": true,
* "code": "SUCCESS",
* "msg": "请求成功",
* "requestId": "163e2f67-5306-4b10-bcbe-a1579d589446"
* }
*
* @apiUse DefaultException
*
* @description : 通过id更新单个记录
* ---------------------------------
* @author : zj
* @since : Create in 2023-05-12
*/
@PostMapping(value = "/modify")
public ResponseData modify(@RequestBody Entrys entrys) {
return success(entrysService.modify(entrys));
}
/**
*
* @api {post} //entrys/create 新增
* @apiName 新增
* @apiGroup Entrys
*
* @apiUse EntrysHeader
* @apiUse EntrysReq
* @apiSuccessExample Success-Response:
* HTTP/1.1 200 OK
* {
* "data": true,
* "code": "SUCCESS",
* "msg": "请求成功",
* "requestId": "163e2f67-5306-4b10-bcbe-a1579d589446"
* }
*
* @apiUse DefaultException
*
* @description : 新增
* ---------------------------------
* @author : zj
* @since : Create in 2023-05-12
*/
@PostMapping(value = "/create")
public ResponseData create(@RequestBody Entrys entrys) {
return success(entrysService.create(entrys));
}
}

View File

@@ -0,0 +1,261 @@
package com.wx.application.core.controller;
import org.springframework.web.bind.annotation.*;
import com.wx.application.base.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import com.wx.application.core.service.FeedbackTypeService;
import com.wx.application.core.entity.FeedbackType;
import com.wx.application.base.ResponseData;
import java.util.Map;
import java.io.Serializable;
/**
* @description : FeedbackType 默认控制器,仅供生成器使用
* ---------------------------------
* @since 2023-05-12
*/
/*@Slf4j*/
@RestController("coreFeedbackTypeController")
@RequestMapping("//feedback-type")
public class FeedbackTypeController extends BaseController {
@Autowired
private FeedbackTypeService feedbackTypeService;
/**
* 定义一些通用的错误信息,供其他 api引用
* @apiDefine DefaultException
* @apiError {String} code 错误码
* @apiError {String} msg 错误描述
* @apiError {String} requestId 请求id标识
*
* @apiErrorExample Error-Response:
* HTTP/1.1 200
* {
* "code": "UNAUTHORIZED",
* "msg": "未授权,请先登录",
* "requestId": "163e2f67-5306-4b10-bcbe-a1579d589446"
* }
*
*/
/**
* 定义标准对象请求的结构体,供api引用
* @apiDefine FeedbackTypeReq
* @apiParam {String} name
*/
/**
* 定义标准对象返回的结构体,供api引用
* @apiDefine FeedbackTypeResp
* @apiSuccess {String} name
*/
/**
* 定义标准头部,供api引用
* @apiDefine FeedbackTypeHeader
* @apiHeader {String} Authorization 用户授权token
* @apiHeaderExample {json} Header-Example:
* {
* "Authorization": "Bearer 1eyJhbGciOiJIUzI1NiJ9....tzNK43MPVQWYYhDwihCAZa88zXzar7KLdgiBBDuUpBM",
* }
*/
/**
*
* @api {post} //feedback-type/query_unique 通过条件查询对象
* @apiName 通过条件查询对象
* @apiGroup FeedbackType
*
* @apiUse FeedbackTypeHeader
* @apiUse FeedbackTypeResp
* @apiSuccessExample Success-Response:
* HTTP/1.1 200 OK
* {
* "data": {
"name": null,
* },
* "code": "SUCCESS",
* "msg": "请求成功",
* "requestId": "163e2f67-5306-4b10-bcbe-a1579d589446"
* }
*
* @apiUse DefaultException
*
* @description : 通过条件查询对象
* 仅查询第一条
* ---------------------------------
* @author : zj
* @since : Create in 2023-05-12
*/
@PostMapping(value = "/query_unique")
public ResponseData queryUnique(@RequestBody Map feedbackTypeQ) {
return success(feedbackTypeService.queryUnique(feedbackTypeQ));
}
/**
*
* @api {post} //feedback-type/query_pages 通过条件分页查询列表
* @apiName 通过条件分页查询列表
* @apiGroup FeedbackType
*
* @apiUse FeedbackTypeHeader
* @apiUse FeedbackTypeResp
* @apiSuccess {Long} total 总数
* @apiSuccess {Long} size 分页大小
* @apiSuccess {Long} current 当前页
* @apiSuccess {Long} orders 排序
* @apiSuccess {Long} pages 总页数
* @apiSuccessExample Success-Response:
* HTTP/1.1 200 OK
* {
* "data": {
* "records": [{
"name": null, * }],
* "total": 1,
* "size": 10,
* "current": 1,
* "orders": [],
* "searchCount": true,
* "pages": 1
* "code": "SUCCESS",
* "msg": "请求成功",
* "requestId": "163e2f67-5306-4b10-bcbe-a1579d589446"
* }
*
* @apiUse DefaultException
*
* @description : 通过条件分页查询列表
* 默认第一页 分页长度为10
* ---------------------------------
* @author : zj
* @since : Create in 2023-05-12
*/
@PostMapping(value = "/query_pages")
public ResponseData queryPages(@RequestBody Map feedbackTypeQ) {
return success(feedbackTypeService.queryPage(feedbackTypeQ));
}
/**
*
* @api {post} //feedback-type/query_list 通过条件查询列表
* @apiName 通过条件查询列表
* @apiGroup FeedbackType
*
* @apiUse FeedbackTypeHeader
* @apiUse FeedbackTypeResp
* @apiSuccessExample Success-Response:
* HTTP/1.1 200 OK
* {
* "data": [{
"name": null,
* }],
* "code": "SUCCESS",
* "msg": "请求成功",
* "requestId": "163e2f67-5306-4b10-bcbe-a1579d589446"
* }
*
* @apiUse DefaultException
*
* @description : 通过条件查询列表
* 不分页直接返回list
* ---------------------------------
* @author : zj
* @since : Create in 2023-05-12
*/
@PostMapping(value = "/query_list")
public ResponseData queryList(@RequestBody Map feedbackTypeQ) {
return success(feedbackTypeService.queryList(feedbackTypeQ));
}
/**
*
* @api {post} //feedback-type/remove/:id 通过id删除单个记录
* @apiName 通过id删除单个记录
* @apiGroup FeedbackType
*
* @apiUse FeedbackTypeHeader
* @apiParam {PK} id 记录主键
* @apiSuccessExample Success-Response:
* HTTP/1.1 200 OK
* {
* "data": true,
* "code": "SUCCESS",
* "msg": "请求成功",
* "requestId": "163e2f67-5306-4b10-bcbe-a1579d589446"
* }
*
* @apiUse DefaultException
*
* @description : 通过id删除单个记录
* ---------------------------------
* @author : zj
* @since : Create in 2023-05-12
*/
@PostMapping(value = "/remove/{id}")
public ResponseData remove(@PathVariable("id") Serializable id) {
return success(feedbackTypeService.remove(id));
}
/**
*
* @api {post} //feedback-type/modify 通过id更新单个记录
* @apiName 通过id更新单个记录
* @apiGroup FeedbackType
*
* @apiUse FeedbackTypeHeader
* @apiParam {PK} id 记录主键
* @apiUse FeedbackTypeReq
* @apiSuccessExample Success-Response:
* HTTP/1.1 200 OK
* {
* "data": true,
* "code": "SUCCESS",
* "msg": "请求成功",
* "requestId": "163e2f67-5306-4b10-bcbe-a1579d589446"
* }
*
* @apiUse DefaultException
*
* @description : 通过id更新单个记录
* ---------------------------------
* @author : zj
* @since : Create in 2023-05-12
*/
@PostMapping(value = "/modify")
public ResponseData modify(@RequestBody FeedbackType feedbackType) {
return success(feedbackTypeService.modify(feedbackType));
}
/**
*
* @api {post} //feedback-type/create 新增
* @apiName 新增
* @apiGroup FeedbackType
*
* @apiUse FeedbackTypeHeader
* @apiUse FeedbackTypeReq
* @apiSuccessExample Success-Response:
* HTTP/1.1 200 OK
* {
* "data": true,
* "code": "SUCCESS",
* "msg": "请求成功",
* "requestId": "163e2f67-5306-4b10-bcbe-a1579d589446"
* }
*
* @apiUse DefaultException
*
* @description : 新增
* ---------------------------------
* @author : zj
* @since : Create in 2023-05-12
*/
@PostMapping(value = "/create")
public ResponseData create(@RequestBody FeedbackType feedbackType) {
return success(feedbackTypeService.create(feedbackType));
}
}

View File

@@ -0,0 +1,42 @@
package com.wx.application.core.controller;
import com.wx.application.base.BaseController;
import com.wx.application.base.ResponseData;
import com.wx.application.core.entity.Entrys;
import com.wx.application.core.service.EntrysService;
import com.wx.application.core.service.RiskUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.io.Serializable;
import java.util.Map;
/**
* @description : Entrys 默认控制器,仅供生成器使用
* ---------------------------------
* @since 2023-05-12
*/
/*@Slf4j*/
@RestController("coreRiskUserController")
@RequestMapping("/risk-user")
public class RiskUserController extends BaseController {
@Autowired
private RiskUserService userService;
@PostMapping(value = "/query_list")
public ResponseData queryList(@RequestBody Map userQ) {
return success(userService.queryList(userQ));
}
@PostMapping(value = "/query_pages")
public ResponseData queryPages(@RequestBody Map entrysQ) {
return success(userService.queryPage(entrysQ));
}
@PostMapping(value = "/query_unique")
public ResponseData queryUnique(@RequestBody Map entrysQ) {
return success(userService.queryUnique(entrysQ));
}
}

View File

@@ -0,0 +1,27 @@
package com.wx.application.core.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.wx.application.base.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
*
* </p>
*
* @author zj
* @since 2023-05-23
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("re_category")
public class Category extends BaseEntity<Long> {
private String name;
}

View File

@@ -0,0 +1,31 @@
package com.wx.application.core.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.wx.application.base.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
*
* </p>
*
* @author zj
* @since 2023-05-12
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("re_entrys")
public class Entrys extends BaseEntity<Long> {
private String fid;
private Boolean isHidden;
private String categories;
private String labels;
private String description;
}

View File

@@ -0,0 +1,27 @@
package com.wx.application.core.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.wx.application.base.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
*
* </p>
*
* @author zj
* @since 2023-05-12
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("re_feedback_type")
public class FeedbackType extends BaseEntity<Long> {
private String name;
private String type;
}

View File

@@ -17,6 +17,8 @@ import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper=false)
public class RiskUser extends BaseEntity<Long> {
private String fid;
private String username;
private String realname;
@@ -25,4 +27,5 @@ public class RiskUser extends BaseEntity<Long> {
private String type;
private String lables;
}

View File

@@ -0,0 +1,18 @@
package com.wx.application.core.mapper;
import com.wx.application.core.entity.Category;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* Mapper 接口
* </p>
*
* @author zj
* @since 2023-05-23
*/
@Repository
public interface CategoryMapper extends BaseMapper<Category> {
}

View File

@@ -0,0 +1,18 @@
package com.wx.application.core.mapper;
import com.wx.application.core.entity.Entrys;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* Mapper 接口
* </p>
*
* @author zj
* @since 2023-05-12
*/
@Repository
public interface EntrysMapper extends BaseMapper<Entrys> {
}

View File

@@ -0,0 +1,18 @@
package com.wx.application.core.mapper;
import com.wx.application.core.entity.FeedbackType;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* Mapper 接口
* </p>
*
* @author zj
* @since 2023-05-12
*/
@Repository
public interface FeedbackTypeMapper extends BaseMapper<FeedbackType> {
}

View File

@@ -0,0 +1,27 @@
package com.wx.application.core.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.wx.application.base.BaseService;
import com.wx.application.core.entity.Category;
import com.wx.application.core.mapper.CategoryMapper;
/**
* <p>
* 服务类
* </p>
*
* @author zj
* @since 2023-05-23
*/
/*@Slf4j*/
@Service("coreCategoryService")
@Transactional
public class CategoryService extends BaseService<Category, CategoryMapper> {
@Autowired
CategoryMapper baseMapper;
}

View File

@@ -0,0 +1,27 @@
package com.wx.application.core.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.wx.application.base.BaseService;
import com.wx.application.core.entity.Entrys;
import com.wx.application.core.mapper.EntrysMapper;
/**
* <p>
* 服务类
* </p>
*
* @author zj
* @since 2023-05-12
*/
/*@Slf4j*/
@Service("coreEntrysService")
@Transactional
public class EntrysService extends BaseService<Entrys, EntrysMapper> {
@Autowired
EntrysMapper baseMapper;
}

View File

@@ -0,0 +1,27 @@
package com.wx.application.core.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.wx.application.base.BaseService;
import com.wx.application.core.entity.FeedbackType;
import com.wx.application.core.mapper.FeedbackTypeMapper;
/**
* <p>
* 服务类
* </p>
*
* @author zj
* @since 2023-05-12
*/
/*@Slf4j*/
@Service("coreFeedbackTypeService")
@Transactional
public class FeedbackTypeService extends BaseService<FeedbackType, FeedbackTypeMapper> {
@Autowired
FeedbackTypeMapper baseMapper;
}

View File

@@ -0,0 +1,71 @@
package com.wx.application.gorse4j;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Objects;
@JsonIgnoreProperties(ignoreUnknown = true)
public class Feedback {
private String feedbackType;
private String userId;
private String itemId;
private String timestamp;
private Item item;
public Feedback() {
}
public void init(String userId, String itemId, String feedbackType) {
this.itemId = itemId;
this.userId = userId;
this.feedbackType = feedbackType;
}
public Feedback(String feedbackType, String userId, String itemId, String timestamp, Item item) {
this.feedbackType = feedbackType;
this.userId = userId;
this.itemId = itemId;
this.timestamp = timestamp;
this.item = item;
}
@JsonProperty("FeedbackType")
public String getFeedbackType() {
return feedbackType;
}
@JsonProperty("UserId")
public String getUserId() {
return userId;
}
@JsonProperty("ItemId")
public String getItemId() {
return itemId;
}
@JsonProperty("Item")
public Item getItem() {
return item;
}
@JsonProperty("Timestamp")
public String getTimestamp() {
return timestamp;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Feedback feedback = (Feedback) o;
return Objects.equals(feedbackType, feedback.feedbackType) && Objects.equals(userId, feedback.userId) && Objects.equals(itemId, feedback.itemId) && Objects.equals(timestamp, feedback.timestamp);
}
@Override
public int hashCode() {
return Objects.hash(feedbackType, userId, itemId, timestamp);
}
}

View File

@@ -0,0 +1,38 @@
package com.wx.application.gorse4j;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
/**
* 查询的分页结果
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class GorsePage {
/**
* 下一页的查询码,查询首页可缺省
*/
private String cursor;
private List<User> users;
private List<Item> items;
@JsonProperty("Cursor")
public String getCursor() {
return cursor;
}
@JsonProperty("Users")
public List<User> getUsers() {
return users;
}
@JsonProperty("Items")
public List<Item> getItems() {
return items;
}
}

View File

@@ -0,0 +1,225 @@
package com.wx.application.gorse4j;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.wx.application.util.CSVUtils;
import com.wx.application.util.HttpUtils;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.mime.MultipartEntityBuilder;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
@Service
public class GorseService {
private String endpoint = "http://43.139.83.67:8088/";
private String apiKey = "";
public static void main(String[] args) throws IOException {
// Create a client.
//Gorse client = new Gorse("", "");
//System.out.println(client.getRecommend("1265177464"));
}
public RowAffected insertUser(User user) throws IOException {
return this.request("POST", this.endpoint + "/api/user", user, RowAffected.class);
}
public User getUser(String userId) throws IOException {
return this.request("GET", this.endpoint + "/api/user/" + userId, null, User.class);
}
public RowAffected deleteUser(String userId) throws IOException {
return this.request("DELETE", this.endpoint + "/api/user/" + userId, null, RowAffected.class);
}
public RowAffected insertItem(Item item) throws IOException {
return this.request("POST", this.endpoint + "/api/item", item, RowAffected.class);
}
public Item getItem(String itemId) throws IOException {
return this.request("GET", this.endpoint + "/api/item/" + itemId, null, Item.class);
}
public RowAffected deleteItem(String itemId) throws IOException {
return this.request("DELETE", this.endpoint + "/api/item/" + itemId, null, RowAffected.class);
}
public Object insertFeedback(List<Feedback> feedbacks) throws IOException {
return HttpUtils.doPost(this.endpoint + "/api/feedback", JSONObject.toJSONString(feedbacks));
// return this.request("POST", this.endpoint + "/api/feedback", feedbacks, RowAffected.class);
}
public List<Feedback> listFeedback(String userId, String feedbackType) throws IOException {
return Arrays.asList(this.request("GET", this.endpoint + "/api/dashboard/user/" + userId + "/feedback/" + feedbackType, null, Feedback[].class));
}
public List<String> getRecommend(String userId) throws IOException {
return Arrays.asList(this.request("GET", this.endpoint + "/api/recommend/" + userId, null, String[].class));
}
public List<Item> getPopular(String category) throws IOException {
return Arrays.asList(this.request("GET", this.endpoint + "/api/dashboard/popular/" + category, null, Item[].class));
}
/**
* 相似(获取相似用户)
*/
public List<User> getSimilarUser(String userId) throws IOException {
return Arrays.asList(this.request("GET", this.endpoint + "/api/dashboard/user/" + userId + "/neighbors", null, User[].class));
}
/**
* 分页查询用户
*/
public GorsePage getUserPageByCursor(String cursor) throws IOException {
String baseUrl = this.endpoint + "/api/dashboard/users";
if (StringUtils.isNotBlank(cursor)) {
baseUrl += ("?cursor=" + cursor);
}
return this.request("GET", baseUrl, null, GorsePage.class);
}
/**
* 查询用户
*/
public User getUserById(String id) throws IOException {
return this.request("GET", this.endpoint + "/api/dashboard/user/" + id, null, User.class);
}
/**
* 分页查询物品
*/
public GorsePage getItemPageByCursor(String cursor) throws IOException {
String baseUrl = this.endpoint + "/api/items";
if (StringUtils.isNotBlank(cursor)) {
baseUrl += ("?cursor=" + cursor);
}
return this.request("GET", baseUrl, null, GorsePage.class);
}
/**
* 查询物品
*/
public Item getItemById(String id) throws IOException {
return this.request("GET", this.endpoint + "/api/item/" + id, null, Item.class);
}
/**
* 洞悉(根据用户获取推荐)
*/
public List<Item> getRecommendByUser(String userId, String recommendation, String category, Integer n) throws IOException {
return Arrays.asList(this.request("GET", this.endpoint + "/api/dashboard/recommend/" + userId
+ "/" + recommendation + "/" + category + "?n=" + ((n == null || n <= 0) ? 10 : n), null, Item[].class));
}
/**
* 相似物品根据物品ID和分类获取相似物品
*/
public List<Item> getSimilarItem(String itemId, String category, Integer n) throws IOException {
String url = this.endpoint + "/api/dashboard/item/" + itemId + "/neighbors";
if (StringUtils.isNotBlank(category)) {
// 当默认查询10条
url += "/" + category + "?n=" + ((n == null || n <= 0) ? 10 : n);
}
System.out.println(url);
return Arrays.asList(this.request("GET", url, null, Item[].class));
}
/**
* 文件方式导入用户或者物品users\items
*/
public JSONObject bulkUserOrItem(Map<String, String> data, MultipartFile multipartFile, String type) throws IOException {
File file = new File("path/to/file");
FileUtils.writeByteArrayToFile(file, multipartFile.getBytes());
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
for (Map.Entry<String, String> entry : data.entrySet()) {
builder.addTextBody(entry.getKey(), entry.getValue());
}
// 导入附加的属性数据到mysql
if ("users".equals(type)) {
List<List<String>> rows = CSVUtils.parseCSV(file, data.get("sep"));
} else if ("items".equals(type)) {
List<List<String>> rows = CSVUtils.parseCSV(file, data.get("sep"));
}
builder.addBinaryBody("file", file, ContentType.APPLICATION_OCTET_STREAM, multipartFile.getOriginalFilename());
return this.sendPostFormData(this.endpoint + "/api/bulk/" + type, builder);
}
/**
* 导出用户或物品信息
*/
public String getBulkUserOrItem(String type) {
return "redirect:" + this.endpoint + "/api/bulk/" + type;
}
public JSONObject sendPostFormData(String url, MultipartEntityBuilder builder) throws IOException {
JSONObject resJson;
HttpClient httpClient = HttpClientBuilder.create().build();
HttpPost httpPost = new HttpPost(url);
HttpEntity entity = builder.build();
httpPost.setEntity(entity);
HttpResponse response = null;
try {
response = httpClient.execute(httpPost);
HttpEntity responseEntity = response.getEntity();
resJson = JSONObject.parseObject(EntityUtils.toString(responseEntity));
} catch (IOException e) {
throw e;
}
return resJson;
}
private <Request, Response> Response request(String method, String url, Request request, Class<Response> responseClass) throws IOException {
HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection();
connection.setRequestMethod(method);
connection.setRequestProperty("X-API-Key", this.apiKey);
connection.setRequestProperty("Content-Type", "application/json");
// Send request
ObjectMapper mapper = new ObjectMapper();
if (request != null) {
connection.setDoOutput(true);
String requestBody = mapper.writeValueAsString(request);
OutputStream outputStream = connection.getOutputStream();
outputStream.write(requestBody.getBytes());
outputStream.flush();
outputStream.close();
}
// Get Response
InputStream inputStream = connection.getInputStream();
return mapper.readValue(inputStream, responseClass);
}
}

View File

@@ -0,0 +1,85 @@
package com.wx.application.gorse4j;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Objects;
public class Item {
private String itemId;
private Boolean isHidden;
private List<String> labels;
private List<String> categories;
private String timestamp;
private String comment;
private Float score;
public Item() {
}
public Item(String itemId, Boolean isHidden, List<String> labels, List<String> categories, String timestamp, String comment,Float score) {
this.itemId = itemId;
this.isHidden = isHidden;
this.labels = labels;
this.categories = categories;
this.timestamp = timestamp;
this.comment = comment;
this.score = score;
}
@JsonProperty("ItemId")
public String getItemId() {
return itemId;
}
@JsonProperty("IsHidden")
public Boolean getIsHidden() {
return isHidden;
}
@JsonProperty("Labels")
public List<String> getLabels() {
return labels;
}
@JsonProperty("Categories")
public List<String> getCategories() {
return categories;
}
@JsonProperty("Timestamp")
public String getTimestamp() {
return timestamp;
}
@JsonProperty("Comment")
public String getComment() {
return comment;
}
@JsonProperty("Score")
public Float getScore() {
return score;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Item item = (Item) o;
return Objects.equals(itemId, item.itemId)
&& Objects.equals(isHidden, item.isHidden)
&& Objects.equals(labels, item.labels)
&& Objects.equals(categories, item.categories)
&& Objects.equals(timestamp, item.timestamp)
&& Objects.equals(comment, item.comment)
&& Objects.equals(score, item.score);
}
@Override
public int hashCode() {
return Objects.hash(itemId, isHidden, labels, categories, timestamp, comment, score);
}
}

View File

@@ -0,0 +1,22 @@
package com.wx.application.gorse4j;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
@JsonIgnoreProperties(ignoreUnknown = true)
public class RowAffected {
private int rowAffected;
public RowAffected() {
}
public RowAffected(int rowAffected) {
this.rowAffected = rowAffected;
}
@JsonProperty("RowAffected")
public int getRowAffected() {
return rowAffected;
}
}

View File

@@ -0,0 +1,19 @@
package com.wx.application.gorse4j;
import com.fasterxml.jackson.annotation.JsonProperty;
public class Score {
private String id;
private double score;
@JsonProperty("Id")
public String getId() {
return id;
}
@JsonProperty("Score")
public double getScore() {
return score;
}
}

View File

@@ -0,0 +1,52 @@
package com.wx.application.gorse4j;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Objects;
@JsonIgnoreProperties(ignoreUnknown = true)
public class User {
private String userId;
private List<String> labels;
private Float score;
public User() {
}
public User(String userId, List<String> labels) {
this.userId = userId;
this.labels = labels;
}
@JsonProperty("UserId")
public String getUserId() {
return userId;
}
@JsonProperty("Labels")
public List<String> getLabels() {
return labels;
}
@JsonProperty("Score")
public Float getScore() {
return score;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
User user = (User) o;
return Objects.equals(userId, user.userId) && Objects.equals(labels, user.labels);
}
@Override
public int hashCode() {
return Objects.hash(userId, labels);
}
}

View File

@@ -730,6 +730,19 @@ public class BaseGraphSerice {
return ResultSetUtils.printResultPath(resultSet);
}
/**
* 根据明确关系查询一个节点的周边一层节点关系
* @param nQ
* @return
*/
public NebulaModel findOnePathById(final String space,final String vid, List<String> relations) {
final String fmtVid = StrUtil.format("\"{}\"", vid);
final String rl = StringUtils.join(relations, "|");
final String fmtrl = StrUtil.format("[r:{}]", rl);
final String nGql = StrUtil.format(GqlTemplate.WITHRELATIONBYID, fmtrl, fmtVid);
ResultSet resultSet = executeGql(space, nGql);
return ResultSetUtils.printResultPath(resultSet);
}
/**
* 查询一个头节点和尾结点的关系

View File

@@ -49,6 +49,8 @@ public interface GqlTemplate {
final static String ONERELATIONBYID = "MATCH p=(n1)-->(n2) where id(n1)=={} RETURN p";
final static String WITHRELATIONBYID = "MATCH p=(n1)-{}->(n2) where id(n1)=={} RETURN p";
final static String ONERELATIONBYSRCIDANDDCTID = "MATCH p=(n1)-->(n2) where id(n1)=={} and id(n2)=={} RETURN p";
final static String PAGING =" | limit {},{}";

View File

@@ -2,6 +2,7 @@ package com.wx.application.nebula.graph.conrtroller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
@@ -11,6 +12,7 @@ import org.springframework.web.multipart.MultipartFile;
import com.wx.application.base.BaseController;
import com.wx.application.base.ResponseData;
import com.wx.application.nebula.graph.service.ImportGraphInJsonService;
import com.wx.application.nebula.graph.service.ImportGraphService;
@RestController
@RequestMapping("/nebula_graph_import")
@@ -19,6 +21,8 @@ public class NebulaImportController extends BaseController {
@Autowired
ImportGraphInJsonService importGraphInJsonService;
@Autowired
ImportGraphService importGraphService;
/**
* 上传zip文件
* @param space
@@ -31,6 +35,18 @@ public class NebulaImportController extends BaseController {
return success(importGraphInJsonService.uploadFile(file, space));
}
@PostMapping(value = "/iptuser")
public ResponseData iptUser() {
importGraphService.iptUser();
return success();
}
@PostMapping(value = "/iptentrys")
public ResponseData iptentrys() {
importGraphService.iptentrys();
return success();
}
/*@Autowired
ImportGraphInExcelService importGraphService;

View File

@@ -382,6 +382,20 @@ public class NebulaOperateController extends BaseController {
return success(nebulaOperateService.findOnePathById(space, vid));
}
/**
* 查询一个节点和明确的关系查询周边一层节点关系
* @param nQ
* @return
*/
@PostMapping(value = "/findonepathbyidwithrelation/{space}/{vid}")
public ResponseData findOnePathById(@PathVariable("space") String space,
@PathVariable("vid") String vid,
@RequestBody NebulaQo nebulaQo) {
return success(nebulaOperateService.findOnePathById(space, vid, nebulaQo.getRelations()));
}
/**
* 查询一个头节点和尾结点的关系
* @param nQ

View File

@@ -1,5 +1,7 @@
package com.wx.application.nebula.graph.query;
import java.util.List;
import lombok.Data;
@Data
@@ -18,5 +20,7 @@ public class NebulaQo {
private Integer page = 1;
private Integer pageSize = 200;
private List<String> relations;
}

View File

@@ -0,0 +1,87 @@
package com.wx.application.nebula.graph.service;
import java.util.HashMap;
import java.util.List;
import java.util.Vector;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wx.application.core.entity.Entrys;
import com.wx.application.core.entity.RiskUser;
import com.wx.application.core.service.EntrysService;
import com.wx.application.core.service.RiskUserService;
import com.wx.application.nebula.graph.bean.NebulaVertex;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@Service
public class ImportGraphService {
@Autowired
NebulaOperateService nebulaOperateService;
@Autowired
RiskUserService riskUserService;
@Autowired
EntrysService entrysService;
public void iptUser() {
List<RiskUser> riskUsers = riskUserService.queryList(new HashMap<>());
List<NebulaVertex> list = new Vector<>();
riskUsers.forEach(v-> {
NebulaVertex vertex = new NebulaVertex();
vertex.setTag("tag_252150072");
vertex.setVid(v.getFid());
list.add(vertex);
if(list.size() > 2000) {
log.info("执行一次 节点导入 {}", list.size());
nebulaOperateService.insertTagAll("recom_gorse", "tag_252150072", list);
list.clear();
}
});
if(list.size() > 0) {
log.info("执行一次 节点导入 {}", list.size());
nebulaOperateService.insertTagAll("recom_gorse", "tag_1412011336", list);
list.clear();
}
}
public void iptentrys() {
List<Entrys> entrys = entrysService.queryList(new HashMap<>());
List<NebulaVertex> list = new Vector<>();
entrys.forEach(v-> {
NebulaVertex vertex = new NebulaVertex();
vertex.setTag("tag_1412011336");
vertex.setVid(v.getFid());
list.add(vertex);
if(list.size() > 2000) {
log.info("执行一次 节点导入 {}", list.size());
nebulaOperateService.insertTagAll("recom_gorse", "tag_1412011336", list);
list.clear();
}
});
if(list.size() > 0) {
log.info("执行一次 节点导入 {}", list.size());
nebulaOperateService.insertTagAll("recom_gorse", "tag_1412011336", list);
list.clear();
}
}
}

View File

@@ -54,11 +54,11 @@ public class DefaultGenerator {
// TODO 数据源配置
DataSourceConfig dsc = new DataSourceConfig();
dsc.setUrl("jdbc:mysql://118.25.104.98:3306/dn_nebula?useUnicode=true&useSSL=false&characterEncoding=utf8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=CONVERT_TO_NULL");
dsc.setUrl("jdbc:mysql://43.139.83.67:13306/recom-gorse?useUnicode=true&useSSL=false&characterEncoding=utf8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=CONVERT_TO_NULL");
// dsc.setSchemaName("public");
dsc.setDriverName("com.mysql.cj.jdbc.Driver");
dsc.setUsername("root");
dsc.setPassword("Whb123321");
dsc.setPassword("AJuSP7F7VTRvm7rk");
mpg.setDataSource(dsc);
// 包配置
@@ -151,7 +151,7 @@ public class DefaultGenerator {
strategy.setControllerMappingHyphenStyle(true);
//TODO 表名前缀
strategy.setTablePrefix("dn" + "_");
strategy.setTablePrefix("re" + "_");
mpg.setStrategy(strategy);
mpg.setTemplateEngine(new VelocityTemplateEngine());
mpg.execute();

View File

@@ -0,0 +1,52 @@
package com.wx.application.util;
import org.apache.commons.lang3.StringUtils;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class CSVUtils {
/**
* @param file
* @param sep 属性分隔符
* @return
* @throws FileNotFoundException
*/
public static List<List<String>> parseCSV(File file, String sep) throws FileNotFoundException {
List<List<String>> rows = new ArrayList<>();
if (file == null) {
return rows;
}
if (StringUtils.isEmpty(sep)) {
sep = ",";
}
try {
Scanner scanner = new Scanner(file);
while (scanner.hasNextLine()) {
String line = scanner.nextLine();
String[] values = line.split(sep);
List<String> row = new ArrayList<>();
for (String value : values) {
row.add(value);
}
rows.add(row);
}
scanner.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
}
return rows;
}
}

View File

@@ -0,0 +1,191 @@
package com.wx.application.util;
import org.apache.http.HttpEntity;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.apache.http.util.EntityUtils;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.URL;
import java.net.URLConnection;
import java.util.List;
import java.util.Map;
public class HttpUtils {
private static PoolingHttpClientConnectionManager connMgr = new PoolingHttpClientConnectionManager();
private static RequestConfig requestConfig;
/**
* 情况方法直接放这里就行
*/
static {
connMgr.setMaxTotal(100);
connMgr.setDefaultMaxPerRoute(connMgr.getMaxTotal());
RequestConfig.Builder configBuilder = RequestConfig.custom();
configBuilder.setConnectTimeout(60000);
configBuilder.setSocketTimeout(70000);
configBuilder.setConnectionRequestTimeout(30000);
requestConfig = configBuilder.build();
}
/**
* 向指定URL发送GET方法的请求
*
* @param url 发送请求的URL
* @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
* @return URL 所代表远程资源的响应结果
*/
public Object sendGet(String url, String param) {
String result = "";
BufferedReader in = null;
try {
String urlNameString = url + "?" + param;
URL realUrl = new URL(urlNameString);
// 打开和URL之间的连接
URLConnection connection = realUrl.openConnection();
// 设置通用的请求属性
connection.setRequestProperty("accept", "*/*");
connection.setRequestProperty("connection", "Keep-Alive");
connection.setRequestProperty("user-agent",
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
// 建立实际的连接
connection.connect();
// 获取所有响应头字段
Map<String, List<String>> map = connection.getHeaderFields();
// 遍历所有的响应头字段
for (String key : map.keySet()) {
System.out.println(key + "--->" + map.get(key));
}
// 定义 BufferedReader输入流来读取URL的响应
in = new BufferedReader(new InputStreamReader(
connection.getInputStream()));
String line;
while ((line = in.readLine()) != null) {
result += line;
}
} catch (Exception e) {
System.out.println("发送GET请求出现异常" + e);
e.printStackTrace();
}
// 使用finally块来关闭输入流
finally {
try {
if (in != null) {
in.close();
}
} catch (Exception e2) {
e2.printStackTrace();
}
}
return result;
}
/**
* 向指定 URL 发送POST方法的请求
*
* @param url 发送请求的 URL
* @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
* @return 所代表远程资源的响应结果
*/
public static Object sendPost(String url, String param) {
PrintWriter out = null;
BufferedReader in = null;
String result = "";
try {
URL realUrl = new URL(url);
// 打开和URL之间的连接
URLConnection conn = realUrl.openConnection();
// 设置通用的请求属性
conn.setRequestProperty("accept", "*/*");
conn.setRequestProperty("connection", "Keep-Alive");
conn.setRequestProperty("user-agent",
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
// 发送POST请求必须设置如下两行
conn.setDoOutput(true);
conn.setDoInput(true);
// 获取URLConnection对象对应的输出流
out = new PrintWriter(conn.getOutputStream());
// 发送请求参数
out.print(param);
// flush输出流的缓冲
out.flush();
// 定义BufferedReader输入流来读取URL的响应
in = new BufferedReader(
new InputStreamReader(conn.getInputStream()));
String line;
while ((line = in.readLine()) != null) {
result += line;
}
} catch (Exception e) {
System.out.println("发送 POST 请求出现异常!" + e);
e.printStackTrace();
}
//使用finally块来关闭输出流、输入流
finally {
try {
if (out != null) {
out.close();
}
if (in != null) {
in.close();
}
} catch (IOException ex) {
ex.printStackTrace();
}
}
return result;
}
/**
* post,以 application/json 形式
* @param apiUrl
* @param json
* @return
*/
public static String doPost(String apiUrl, String json) {
long start = System.currentTimeMillis();
CloseableHttpClient httpClient = HttpClients.createDefault();
String httpStr = null;
HttpPost httpPost = new HttpPost(apiUrl);
CloseableHttpResponse response = null;
int statusCode = -999;
try {
httpPost.setConfig(requestConfig);
StringEntity stringEntity = new StringEntity(json.toString(), "UTF-8");
stringEntity.setContentEncoding("UTF-8");
stringEntity.setContentType("application/json");
httpPost.setEntity(stringEntity);
response = httpClient.execute(httpPost);
HttpEntity entity = response.getEntity();
statusCode = response.getStatusLine().getStatusCode();
httpStr = EntityUtils.toString(entity, "UTF-8");
} catch (Exception var20) {
var20.printStackTrace();
} finally {
if (response != null) {
try {
EntityUtils.consume(response.getEntity());
} catch (IOException var19) {
var19.printStackTrace();
}
}
}
return httpStr;
}
}

View File

@@ -11,6 +11,7 @@ spring.servlet.multipart.max-file-size=2048MB
spring.servlet.multipart.max-request-size=2048MB
server.port=@server_port@
ignore.urls[0]=/login/**
ignore.urls[1]=/bulk/get_bulk/**
upload.graph.path=@upload_graph_path@
zbx.path=@zbx_path@

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.wx.application.core.mapper.CategoryMapper">
</mapper>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.wx.application.core.mapper.EntrysMapper">
</mapper>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.wx.application.core.mapper.FeedbackTypeMapper">
</mapper>

29
web/package-lock.json generated
View File

@@ -2141,7 +2141,7 @@
},
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"optional": true,
@@ -2177,7 +2177,7 @@
},
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
"resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"optional": true,
@@ -2188,7 +2188,7 @@
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"optional": true,
@@ -2198,7 +2198,7 @@
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"optional": true
@@ -2217,14 +2217,14 @@
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"loader-utils": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz",
"resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-2.0.4.tgz",
"integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==",
"dev": true,
"optional": true,
@@ -2252,7 +2252,7 @@
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
@@ -2279,7 +2279,7 @@
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.8.3",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.3.tgz",
"resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-16.8.3.tgz",
"integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
"dev": true,
"optional": true,
@@ -9996,6 +9996,11 @@
"integrity": "sha1-bJWZ00DVTf05RjgCUqNXBaa5kr8=",
"dev": true
},
"papaparse": {
"version": "5.4.1",
"resolved": "https://registry.npmmirror.com/papaparse/-/papaparse-5.4.1.tgz",
"integrity": "sha512-HipMsgJkZu8br23pW15uvo6sib6wne/4woLZPlFf3rpDyMe9ywEXUsuD7+6K9PRkJlVT51j/sCOYDKGGS3ZJrw=="
},
"parallel-transform": {
"version": "1.2.0",
"resolved": "https://registry.npm.taobao.org/parallel-transform/download/parallel-transform-1.2.0.tgz",
@@ -14600,6 +14605,14 @@
}
}
},
"vue-papa-parse": {
"version": "3.1.0",
"resolved": "https://registry.npmmirror.com/vue-papa-parse/-/vue-papa-parse-3.1.0.tgz",
"integrity": "sha512-5YdF3Dtf49EGfaz3+IgIpUw9yYuvV3HekZkob6jrK/Ffz1aCrWjevtcQByKxrNtK7RAL39B0ca93bogKuiQQKg==",
"requires": {
"papaparse": "^5.3.0"
}
},
"vue-quill-editor": {
"version": "3.0.6",
"resolved": "https://registry.npm.taobao.org/vue-quill-editor/download/vue-quill-editor-3.0.6.tgz",

View File

@@ -32,6 +32,7 @@
"vue": "^2.6.11",
"vue-axios": "^3.2.4",
"vue-json-editor": "^1.4.3",
"vue-papa-parse": "^3.1.0",
"vue-quill-editor": "^3.0.6",
"vuex": "^3.1.0"
},

BIN
web/public/template.xlsx Normal file

Binary file not shown.

View File

@@ -21,17 +21,23 @@ html, body, #app {
}
.el-table th.is-leaf {
background: rgba(250, 250, 250, 1);
background: rgba(235,241,255);
border-top: 1px solid #EBEEF5;
}
.el-table th.el-table__cell{
background: rgba(235,241,255)!important;
color: #333333!important;
font-weight: normal!important;
}
.menu-content {
margin: 25px;
background: #FFFFFF;
overflow: auto;
position: absolute;
left: 290px;
top: 100px;
left: 260px;
top: 40px;
bottom: 0;
right: 0;
padding: 25px;
@@ -70,4 +76,75 @@ html, body, #app {
height: 178px;
display: block;
}
.login-input .el-input__inner{
height: 60px!important;
line-height: 60px!important;
border-radius: 10px!important;
font-size: 16px!important;
padding: 0px 30px 0 60px!important;
}
.login-input i{
font-size: 30px!important;
line-height: 60px!important;
margin-left: 15px!important;
}
.login-button{
height: 60px!important;
width: 100%!important;
border-radius: 10px!important;
//background: rgba(16,108,255, 1);
border: none;
font-size: 16px!important;
letter-spacing:5px!important;
margin-bottom: 20px;
}
/*滚动条样式*/
::-webkit-scrollbar {/*滚动条整体样式*/
width: 8px; /*高宽分别对应横竖滚动条的尺寸*/
height: 1px;
}
::-webkit-scrollbar-thumb {/*滚动条里面小方块*/
border-radius: 5px;
-webkit-box-shadow: inset 0 0 5px #d9d9d9;
background: #d9d9d9;
}
::-webkit-scrollbar-track { /*滚动条里面轨道*/
-webkit-box-shadow: inset 0 0 5px #ffffff;
border-radius: 0;
background: #ffffff;
}
.el-dialog__header{
background: cornflowerblue;
padding-bottom:15px!important;
padding-top: 15px!important;
}
.el-dialog__title{
color: #ffffff!important;
}
.el-dialog__headerbtn .el-dialog__close{
color: #ffffff!important;
}
.el-dialog__body{
padding-bottom:20px!important;
}
.content-box .el-input__inner{
height: 33px!important;
line-height: 33px!important;
}
.content-box .el-button--primary,.content-box .el-button--default{
padding: 9px 15px!important;
font-size: 12px!important;
}
</style>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 171 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 234 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 212 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 249 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 225 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 277 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 135 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 152 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 160 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 148 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 168 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

@@ -20,13 +20,13 @@
<label>查询中</label>
</div>
<el-form-item :label="item.comment" v-for="item in infoList" :key="item.field">
<el-input v-model="item.value"></el-input>
<el-input v-model="item.value" disabled></el-input>
</el-form-item>
</el-form>
<div class="btn-box">
<el-button type="danger" @click="removeItem" v-show="editFlag"> </el-button>
<el-button type="primary" @click="submitUpdate"> </el-button>
</div>
<!-- <div class="btn-box">-->
<!-- <el-button type="danger" @click="removeItem" v-show="editFlag"> </el-button>-->
<!-- <el-button type="primary" @click="submitUpdate"> </el-button>-->
<!-- </div>-->
</div>
</template>
@@ -96,7 +96,9 @@ export default {
method: 'get',
data: {}
}).then(res => {
vm.form[comment] = getFirstStringProperty(res.data.properties);
// vm.form[comment] = getFirstStringProperty(res.data.properties);
vm.form[comment] = vid;
});
},
queryEdgeDetail(edgeType, srcVid, dstVid) {
@@ -141,7 +143,8 @@ export default {
let _infoList = [];
Reflect.ownKeys(properties).forEach(key => {
_infoList.push({
comment: map[key],
// comment: map[key],
comment: key,
field: key,
value: properties[key]
});

Some files were not shown because too many files have changed in this diff Show More