作者 Administrator

合并分支 'dev' 到 'master'

Dev



查看合并请求 !1
正在显示 33 个修改的文件 包含 3680 行增加364 行删除

要显示太多修改。

为保证性能只显示 33 of 33+ 个文件。

#mmm-worth
\ No newline at end of file
#mmm-worth 1
\ No newline at end of file
... ...
#!/bin/bash
export PATH=/root/local/bin:$PATH
kubectl -n mmm-worth-dev get pods | grep -q mmm-worth
kubectl -n mmm-suplus-dev get pods | grep -q mmm-worth
if [ "$?" == "1" ];then
kubectl create -f /tmp/dev/mmm-worth/mmm-worth.yaml --record
kubectl -n mmm-worth-dev get svc | grep -q mmm-worth
kubectl -n mmm-suplus-dev get svc | grep -q mmm-worth
if [ "$?" == "0" ];then
echo "mmm-worth service install success!"
else
echo "mmm-worth service install fail!"
fi
kubectl -n mmm-worth-dev get pods | grep -q mmm-worth
kubectl -n mmm-suplus-dev get pods | grep -q mmm-worth
if [ "$?" == "0" ];then
echo "mmm-worth deployment install success!"
else
... ... @@ -17,24 +17,24 @@ if [ "$?" == "1" ];then
fi
else
kubectl delete -f /tmp/dev/mmm-worth/mmm-worth.yaml
kubectl -n mmm-worth-dev get svc | grep -q mmm-worth
kubectl -n mmm-suplus-dev get svc | grep -q mmm-worth
while [ "$?" == "0" ]
do
kubectl -n mmm-worth-dev get svc | grep -q mmm-worth
kubectl -n mmm-suplus-dev get svc | grep -q mmm-worth
done
kubectl -n mmm-worth-dev get pods | grep -q mmm-worth
kubectl -n mmm-suplus-dev get pods | grep -q mmm-worth
while [ "$?" == "0" ]
do
kubectl -n mmm-worth-dev get pods | grep -q mmm-worth
kubectl -n mmm-suplus-dev get pods | grep -q mmm-worth
done
kubectl create -f /tmp/dev/mmm-worth/mmm-worth.yaml --record
kubectl -n mmm-worth-dev get svc | grep -q mmm-worth
kubectl -n mmm-suplus-dev get svc | grep -q mmm-worth
if [ "$?" == "0" ];then
echo "mmm-worth service update success!"
else
echo "mmm-worth service update fail!"
fi
kubectl -n mmm-worth-dev get pods | grep -q mmm-worth
kubectl -n mmm-suplus-dev get pods | grep -q mmm-worth
if [ "$?" == "0" ];then
echo "mmm-worth deployment update success!"
else
... ...
... ... @@ -2,7 +2,7 @@ apiVersion: v1
kind: Service
metadata:
name: mmm-worth
namespace: mmm-worth-dev
namespace: mmm-suplus-dev
labels:
k8s-app: mmm-worth
spec:
... ... @@ -17,7 +17,7 @@ apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: mmm-worth
namespace: mmm-worth-dev
namespace: mmm-suplus-dev
labels:
k8s-app: mmm-worth
spec:
... ... @@ -53,7 +53,7 @@ spec:
name: accesslogs
env:
- name: POSTGRESQL_DB_NAME
value: "mmm-worth"
value: "mmmworth"
- name: POSTGRESQL_USER
value: "postgres"
- name: POSTGRESQL_PASSWORD
... ... @@ -68,6 +68,8 @@ spec:
value: "1"
- name: ERROR_BASE_CODE_MULTIPLE
value: "1000"
- name: ABILITY_SERVICE_HOST
value: "https://ability-dev.fjmaimaimai.com"
volumes:
- name: accesslogs
emptyDir: {}
\ No newline at end of file
... ...
#!/bin/bash
export PATH=/root/local/bin:$PATH
kubectl -n mmm-suplus-test get pods | grep -q mmm-worth
if [ "$?" == "1" ];then
kubectl create -f /tmp/test/mmm-worth/mmm-worth.yaml --record
kubectl -n mmm-suplus-test get svc | grep -q mmm-worth
if [ "$?" == "0" ];then
echo "mmm-worth service install success!"
else
echo "mmm-worth service install fail!"
fi
kubectl -n mmm-suplus-test get pods | grep -q mmm-worth
if [ "$?" == "0" ];then
echo "mmm-worth deployment install success!"
else
echo "mmm-worth deployment install fail!"
fi
else
kubectl delete -f /tmp/test/mmm-worth/mmm-worth.yaml
kubectl -n mmm-suplus-test get svc | grep -q mmm-worth
while [ "$?" == "0" ]
do
kubectl -n mmm-suplus-test get svc | grep -q mmm-worth
done
kubectl -n mmm-suplus-test get pods | grep -q mmm-worth
while [ "$?" == "0" ]
do
kubectl -n mmm-suplus-test get pods | grep -q mmm-worth
done
kubectl create -f /tmp/test/mmm-worth/mmm-worth.yaml --record
kubectl -n mmm-suplus-test get svc | grep -q mmm-worth
if [ "$?" == "0" ];then
echo "mmm-worth service update success!"
else
echo "mmm-worth service update fail!"
fi
kubectl -n mmm-suplus-test get pods | grep -q mmm-worth
if [ "$?" == "0" ];then
echo "mmm-worth deployment update success!"
else
echo "mmm-worth deployment update fail!"
fi
fi
\ No newline at end of file
... ...
apiVersion: v1
kind: Service
metadata:
name: mmm-worth
namespace: mmm-suplus-test
labels:
k8s-app: mmm-worth
spec:
ports:
- name: "http"
port: 80
targetPort: 8082
selector:
k8s-app: mmm-worth
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: mmm-worth
namespace: mmm-suplus-test
labels:
k8s-app: mmm-worth
spec:
replicas: 1
template:
metadata:
labels:
k8s-app: mmm-worth
spec:
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- preference: {}
weight: 100
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- cn-hangzhou.i-bp1djh1xn7taumbue1ze
- cn-hangzhou.i-bp1djh1xn7taumbue1zd
- cn-hangzhou.i-bp1euf5u1ph9kbhtndhb
- cn-hangzhou.i-bp1hyp5oips9cdwxxgxy
containers:
- name: mmm-worth
image: 192.168.0.243:5000/mmm/mmm-worth:test
imagePullPolicy: Always
ports:
- containerPort: 8082
volumeMounts:
- mountPath: /opt/logs
name: accesslogs
env:
- name: POSTGRESQL_DB_NAME
value: "mmmworthtest"
- name: POSTGRESQL_USER
value: "postgres"
- name: POSTGRESQL_PASSWORD
value: "postgres_15432"
- name: POSTGRESQL_HOST
value: "101.37.68.23"
- name: POSTGRESQL_PORT
value: "15432"
- name: LOG_LEVEL
value: "debug"
- name: ERROR_BASE_CODE
value: "1"
- name: ERROR_BASE_CODE_MULTIPLE
value: "1000"
- name: ABILITY_SERVICE_HOST
value: "https://ability-test.fjmaimaimai.com"
volumes:
- name: accesslogs
emptyDir: {}
\ No newline at end of file
... ...
... ... @@ -18,6 +18,153 @@
"application/xml"
],
"paths": {
"/config/bid-time-matchs": {
"get": {
"tags": [
"config"
],
"summary": "返回竞标时间字典列表(1全部,2已截止,3未截止)",
"description": "返回竞标时间字典列表(1全部,2已截止,3未截止)",
"operationId": "config#listBidTimeMatch",
"responses": {
"200": {
"description": "OK response.",
"schema": {
"$ref": "#/definitions/ConfigListBidTimeMatchResponseBody"
}
}
},
"schemes": [
"http"
]
}
},
"/config/customer-values": {
"get": {
"tags": [
"config"
],
"summary": "返回客户价值字典列表",
"description": "返回客户价值字典列表",
"operationId": "config#listCustomerValue",
"responses": {
"200": {
"description": "OK response.",
"schema": {
"$ref": "#/definitions/ConfigListCustomerValueResponseBody"
}
}
},
"schemes": [
"http"
]
}
},
"/config/employee-permissions": {
"get": {
"tags": [
"config"
],
"summary": "返回员工权限字典列表(1任务管理,2素币管理,3成员管理)",
"description": "返回员工权限字典列表(1任务管理,2素币管理,3成员管理)",
"operationId": "config#listEmployeePermission",
"responses": {
"200": {
"description": "OK response.",
"schema": {
"$ref": "#/definitions/ConfigListEmployeePermissionResponseBody"
}
}
},
"schemes": [
"http"
]
}
},
"/config/reference-resource-types": {
"get": {
"tags": [
"config"
],
"summary": "返回任务引用资源类型字典列表",
"description": "返回任务引用资源类型字典列表",
"operationId": "config#listReferenceResourceType",
"responses": {
"200": {
"description": "OK response.",
"schema": {
"$ref": "#/definitions/ConfigListReferenceResourceTypeResponseBody"
}
}
},
"schemes": [
"http"
]
}
},
"/config/task-natures": {
"get": {
"tags": [
"config"
],
"summary": "返回任务性质字典列表",
"description": "返回任务性质字典列表",
"operationId": "config#listTaskNature",
"responses": {
"200": {
"description": "OK response.",
"schema": {
"$ref": "#/definitions/ConfigListTaskNatureResponseBody"
}
}
},
"schemes": [
"http"
]
}
},
"/config/task-statuses": {
"get": {
"tags": [
"config"
],
"summary": "返回任务状态字典列表",
"description": "返回任务状态字典列表",
"operationId": "config#listTaskStatus",
"responses": {
"200": {
"description": "OK response.",
"schema": {
"$ref": "#/definitions/ConfigListTaskStatusResponseBody"
}
}
},
"schemes": [
"http"
]
}
},
"/config/task-types": {
"get": {
"tags": [
"config"
],
"summary": "返回任务类型字典列表",
"description": "返回任务类型字典列表",
"operationId": "config#listTaskType",
"responses": {
"200": {
"description": "OK response.",
"schema": {
"$ref": "#/definitions/ConfigListTaskTypeResponseBody"
}
}
},
"schemes": [
"http"
]
}
},
"/employees": {
"get": {
"tags": [
... ... @@ -28,6 +175,20 @@
"operationId": "employee#listEmployee",
"parameters": [
{
"name": "companyId",
"in": "query",
"description": "公司ID",
"required": false,
"type": "integer"
},
{
"name": "employeeNameMatch",
"in": "query",
"description": "员工姓名匹配",
"required": false,
"type": "string"
},
{
"name": "offset",
"in": "query",
"description": "查询偏离量",
... ... @@ -178,107 +339,20 @@
]
}
},
"/tasks": {
"/off-task-records/{offTaskRecordId}": {
"get": {
"tags": [
"task"
"offTaskRecord"
],
"summary": "返回任务列表",
"description": "返回任务列表",
"operationId": "task#listTask",
"summary": "返回关闭任务记录",
"description": "返回关闭任务记录",
"operationId": "offTaskRecord#getOffTaskRecord",
"parameters": [
{
"name": "companyId",
"in": "query",
"description": "公司ID",
"required": false,
"type": "integer"
},
{
"name": "sponsor",
"in": "query",
"description": "任务发起者",
"required": false,
"type": "integer",
"format": "int64"
},
{
"name": "taskContentMatch",
"in": "query",
"description": "任务内容匹配",
"required": false,
"type": "string"
},
{
"name": "taskType",
"in": "query",
"description": "任务类型",
"required": false,
"type": "integer"
},
{
"name": "taskStatus",
"in": "query",
"description": "任务状态",
"required": false,
"type": "integer"
},
{
"name": "customerValue",
"in": "query",
"description": "客户价值",
"required": false,
"type": "string"
},
{
"name": "taskNature",
"in": "query",
"description": "任务性质",
"required": false,
"type": "string"
},
{
"name": "isRewardTake",
"in": "query",
"description": "是否悬赏任务",
"required": false,
"type": "boolean"
},
{
"name": "bidTimeMatch",
"in": "query",
"description": "竞标时间(1全部,2已截止,3未截止)",
"required": false,
"type": "integer"
},
{
"name": "receiver",
"in": "query",
"description": "任务领取人",
"required": false,
"type": "integer",
"format": "int64"
},
{
"name": "participator",
"in": "query",
"description": "任务参与者",
"required": false,
"type": "integer",
"format": "int64"
},
{
"name": "offset",
"in": "query",
"description": "查询偏离量",
"required": false,
"type": "integer"
},
{
"name": "limit",
"in": "query",
"description": "查询限制",
"required": false,
"name": "offTaskRecordId",
"in": "path",
"description": "关闭任务记录ID",
"required": true,
"type": "integer"
}
],
... ... @@ -286,28 +360,30 @@
"200": {
"description": "OK response.",
"schema": {
"$ref": "#/definitions/TaskListTaskResponseBody"
"$ref": "#/definitions/OffTaskRecordGetOffTaskRecordResponseBody"
}
}
},
"schemes": [
"http"
]
}
},
"/off-task-records/search-off-task-record": {
"post": {
"tags": [
"task"
"offTaskRecord"
],
"summary": "创建新任务",
"description": "创建新任务",
"operationId": "task#createTask",
"summary": "搜索关闭任务记录",
"description": "搜索关闭任务记录",
"operationId": "offTaskRecord#searchOffTaskRecord",
"parameters": [
{
"name": "CreateTaskRequestBody",
"name": "SearchOffTaskRecordRequestBody",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/TaskCreateTaskRequestBody"
"$ref": "#/definitions/OffTaskRecordSearchOffTaskRecordRequestBody"
}
}
],
... ... @@ -315,7 +391,7 @@
"200": {
"description": "OK response.",
"schema": {
"$ref": "#/definitions/TaskCreateTaskResponseBody"
"$ref": "#/definitions/OffTaskRecordSearchOffTaskRecordResponseBody"
}
}
},
... ... @@ -324,56 +400,52 @@
]
}
},
"/tasks/{taskId}": {
"get": {
"/statistics/person-su-money": {
"post": {
"tags": [
"task"
"statistics"
],
"summary": "返回任务",
"description": "返回任务",
"operationId": "task#getTask",
"summary": "获取个人素币统计",
"description": "获取个人素币统计",
"operationId": "statistics#personSuMoneyStatistics",
"parameters": [
{
"name": "taskId",
"in": "path",
"description": "任务ID",
"name": "PersonSuMoneyStatisticsRequestBody",
"in": "body",
"required": true,
"type": "integer"
"schema": {
"$ref": "#/definitions/StatisticsPersonSuMoneyStatisticsRequestBody"
}
}
],
"responses": {
"200": {
"description": "OK response.",
"schema": {
"$ref": "#/definitions/TaskGetTaskResponseBody"
"$ref": "#/definitions/StatisticsPersonSuMoneyStatisticsResponseBody"
}
}
},
"schemes": [
"http"
]
}
},
"put": {
"/statistics/person-task": {
"post": {
"tags": [
"task"
"statistics"
],
"summary": "更新任务",
"description": "更新任务",
"operationId": "task#updateTask",
"summary": "获取个人任务统计",
"description": "获取个人任务统计",
"operationId": "statistics#personTaskStatistics",
"parameters": [
{
"name": "taskId",
"in": "path",
"description": "任务ID",
"required": true,
"type": "integer"
},
{
"name": "UpdateTaskRequestBody",
"name": "PersonTaskStatisticsRequestBody",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/TaskUpdateTaskRequestBody"
"$ref": "#/definitions/StatisticsPersonTaskStatisticsRequestBody"
}
}
],
... ... @@ -381,35 +453,38 @@
"200": {
"description": "OK response.",
"schema": {
"$ref": "#/definitions/TaskUpdateTaskResponseBody"
"$ref": "#/definitions/StatisticsPersonTaskStatisticsResponseBody"
}
}
},
"schemes": [
"http"
]
}
},
"delete": {
"/statistics/system-task": {
"post": {
"tags": [
"task"
"statistics"
],
"summary": "移除任务",
"description": "移除任务",
"operationId": "task#removeTask",
"summary": "获取系统任务统计",
"description": "获取系统任务统计",
"operationId": "statistics#systemTaskStatistics",
"parameters": [
{
"name": "taskId",
"in": "path",
"description": "任务ID",
"name": "SystemTaskStatisticsRequestBody",
"in": "body",
"required": true,
"type": "integer"
"schema": {
"$ref": "#/definitions/StatisticsSystemTaskStatisticsRequestBody"
}
}
],
"responses": {
"200": {
"description": "OK response.",
"schema": {
"$ref": "#/definitions/TaskRemoveTaskResponseBody"
"$ref": "#/definitions/StatisticsSystemTaskStatisticsResponseBody"
}
}
},
... ... @@ -418,28 +493,21 @@
]
}
},
"/tasks/{taskId}/acceptance": {
"/su-money/exchange": {
"post": {
"tags": [
"task"
"suMoney"
],
"summary": "验收任务",
"description": "验收任务",
"operationId": "task#acceptanceTask",
"summary": "素币兑换",
"description": "素币兑换",
"operationId": "suMoney#exchangeSuMoney",
"parameters": [
{
"name": "taskId",
"in": "path",
"description": "任务ID",
"required": true,
"type": "integer"
},
{
"name": "AcceptanceTaskRequestBody",
"name": "ExchangeSuMoneyRequestBody",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/TaskAcceptanceTaskRequestBody"
"$ref": "#/definitions/SuMoneyExchangeSuMoneyRequestBody"
}
}
],
... ... @@ -447,7 +515,7 @@
"200": {
"description": "OK response.",
"schema": {
"$ref": "#/definitions/TaskAcceptanceTaskResponseBody"
"$ref": "#/definitions/SuMoneyExchangeSuMoneyResponseBody"
}
}
},
... ... @@ -456,28 +524,21 @@
]
}
},
"/tasks/{taskId}/apply-complete": {
"/su-money/search-su-money-transaction-record": {
"post": {
"tags": [
"task"
"suMoney"
],
"summary": "申请完成任务",
"description": "申请完成任务",
"operationId": "task#applyCompleteTask",
"summary": "搜索素币事务记录",
"description": "搜索素币事务记录",
"operationId": "suMoney#searchSuMoneyTransactionRecord",
"parameters": [
{
"name": "taskId",
"in": "path",
"description": "任务ID",
"required": true,
"type": "integer"
},
{
"name": "ApplyCompleteTaskRequestBody",
"name": "SearchSuMoneyTransactionRecordRequestBody",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/TaskApplyCompleteTaskRequestBody"
"$ref": "#/definitions/SuMoneySearchSuMoneyTransactionRecordRequestBody"
}
}
],
... ... @@ -485,7 +546,7 @@
"200": {
"description": "OK response.",
"schema": {
"$ref": "#/definitions/TaskApplyCompleteTaskResponseBody"
"$ref": "#/definitions/SuMoneySearchSuMoneyTransactionRecordResponseBody"
}
}
},
... ... @@ -494,28 +555,21 @@
]
}
},
"/tasks/{taskId}/bid": {
"/su-money/su-money-transaction-record-statistics": {
"post": {
"tags": [
"task"
"suMoney"
],
"summary": "对任务进行竞标",
"description": "对任务进行竞标",
"operationId": "task#bidTask",
"summary": "素币事务记录统计",
"description": "素币事务记录统计",
"operationId": "suMoney#suMoneyTransactionRecordStatistics",
"parameters": [
{
"name": "taskId",
"in": "path",
"description": "任务ID",
"required": true,
"type": "integer"
},
{
"name": "BidTaskRequestBody",
"name": "SuMoneyTransactionRecordStatisticsRequestBody",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/TaskBidTaskRequestBody"
"$ref": "#/definitions/SuMoneySuMoneyTransactionRecordStatisticsRequestBody"
}
}
],
... ... @@ -523,7 +577,7 @@
"200": {
"description": "OK response.",
"schema": {
"$ref": "#/definitions/TaskBidTaskResponseBody"
"$ref": "#/definitions/SuMoneySuMoneyTransactionRecordStatisticsResponseBody"
}
}
},
... ... @@ -532,28 +586,170 @@
]
}
},
"/tasks/{taskId}/choose-successful-bidder": {
"post": {
"/su-money/su-money-transaction-records/{suMoneyTransactionRecordId}": {
"get": {
"tags": [
"task"
"suMoney"
],
"summary": "选择竞标任务的中标人",
"description": "选择竞标任务的中标人",
"operationId": "task#chooseSuccessfulBidder",
"summary": "返回素币事务记录",
"description": "返回素币事务记录",
"operationId": "suMoney#getSuMoneyTransactionRecord",
"parameters": [
{
"name": "taskId",
"name": "suMoneyTransactionRecordId",
"in": "path",
"description": "任务ID",
"description": "素币事务记录ID",
"required": true,
"type": "integer"
}
],
"responses": {
"200": {
"description": "OK response.",
"schema": {
"$ref": "#/definitions/SuMoneyGetSuMoneyTransactionRecordResponseBody"
}
}
},
"schemes": [
"http"
]
}
},
"/tasks": {
"get": {
"tags": [
"task"
],
"summary": "返回任务列表",
"description": "返回任务列表",
"operationId": "task#listTask",
"parameters": [
{
"name": "ChooseSuccessfulBidderRequestBody",
"name": "companyId",
"in": "query",
"description": "公司ID",
"required": false,
"type": "integer"
},
{
"name": "sponsor",
"in": "query",
"description": "任务发起者UID",
"required": false,
"type": "integer",
"format": "int64"
},
{
"name": "taskContentMatch",
"in": "query",
"description": "任务内容匹配",
"required": false,
"type": "string"
},
{
"name": "taskType",
"in": "query",
"description": "任务类型",
"required": false,
"type": "integer"
},
{
"name": "taskStatus",
"in": "query",
"description": "任务状态",
"required": false,
"type": "integer"
},
{
"name": "customerValue",
"in": "query",
"description": "客户价值",
"required": false,
"type": "array",
"items": {
"type": "string"
},
"collectionFormat": "multi"
},
{
"name": "taskNature",
"in": "query",
"description": "任务性质",
"required": false,
"type": "string"
},
{
"name": "isRewardTake",
"in": "query",
"description": "是否悬赏任务",
"required": false,
"type": "boolean"
},
{
"name": "bidTimeMatch",
"in": "query",
"description": "竞标时间(1全部,2已截止,3未截止)",
"required": false,
"type": "integer"
},
{
"name": "receiver",
"in": "query",
"description": "任务领取人UID",
"required": false,
"type": "integer",
"format": "int64"
},
{
"name": "participator",
"in": "query",
"description": "任务参与者UID",
"required": false,
"type": "integer",
"format": "int64"
},
{
"name": "offset",
"in": "query",
"description": "查询偏离量",
"required": false,
"type": "integer"
},
{
"name": "limit",
"in": "query",
"description": "查询限制",
"required": false,
"type": "integer"
}
],
"responses": {
"200": {
"description": "OK response.",
"schema": {
"$ref": "#/definitions/TaskListTaskResponseBody"
}
}
},
"schemes": [
"http"
]
},
"post": {
"tags": [
"task"
],
"summary": "创建新任务",
"description": "创建新任务",
"operationId": "task#createTask",
"parameters": [
{
"name": "CreateTaskRequestBody",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/TaskChooseSuccessfulBidderRequestBody"
"$ref": "#/definitions/TaskCreateTaskRequestBody"
}
}
],
... ... @@ -561,7 +757,7 @@
"200": {
"description": "OK response.",
"schema": {
"$ref": "#/definitions/TaskChooseSuccessfulBidderResponseBody"
"$ref": "#/definitions/TaskCreateTaskResponseBody"
}
}
},
... ... @@ -570,14 +766,14 @@
]
}
},
"/tasks/{taskId}/dff": {
"post": {
"/tasks/{taskId}": {
"get": {
"tags": [
"task"
],
"summary": "关闭任务",
"description": "关闭任务",
"operationId": "task#offTask",
"summary": "返回任务",
"description": "返回任务",
"operationId": "task#getTask",
"parameters": [
{
"name": "taskId",
... ... @@ -585,37 +781,27 @@
"description": "任务ID",
"required": true,
"type": "integer"
},
{
"name": "OffTaskRequestBody",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/TaskOffTaskRequestBody"
}
}
],
"responses": {
"200": {
"description": "OK response.",
"schema": {
"$ref": "#/definitions/TaskOffTaskResponseBody"
"$ref": "#/definitions/TaskGetTaskResponseBody"
}
}
},
"schemes": [
"http"
]
}
},
"/tasks/{taskId}/release": {
"post": {
"put": {
"tags": [
"task"
],
"summary": "发布任务",
"description": "发布任务",
"operationId": "task#releaseTask",
"summary": "更新任务",
"description": "更新任务",
"operationId": "task#updateTask",
"parameters": [
{
"name": "taskId",
... ... @@ -625,11 +811,11 @@
"type": "integer"
},
{
"name": "ReleaseTaskRequestBody",
"name": "UpdateTaskRequestBody",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/TaskReleaseTaskRequestBody"
"$ref": "#/definitions/TaskUpdateTaskRequestBody"
}
}
],
... ... @@ -637,23 +823,241 @@
"200": {
"description": "OK response.",
"schema": {
"$ref": "#/definitions/TaskReleaseTaskResponseBody"
"$ref": "#/definitions/TaskUpdateTaskResponseBody"
}
}
},
"schemes": [
"http"
]
}
},
"/tasks/{taskId}/rob": {
"post": {
"delete": {
"tags": [
"task"
],
"summary": "对任务进行抢单",
"description": "对任务进行抢单",
"operationId": "task#robTask",
"summary": "移除任务",
"description": "移除任务",
"operationId": "task#removeTask",
"parameters": [
{
"name": "taskId",
"in": "path",
"description": "任务ID",
"required": true,
"type": "integer"
}
],
"responses": {
"200": {
"description": "OK response.",
"schema": {
"$ref": "#/definitions/TaskRemoveTaskResponseBody"
}
}
},
"schemes": [
"http"
]
}
},
"/tasks/{taskId}/acceptance": {
"post": {
"tags": [
"task"
],
"summary": "验收任务",
"description": "验收任务",
"operationId": "task#acceptanceTask",
"parameters": [
{
"name": "taskId",
"in": "path",
"description": "任务ID",
"required": true,
"type": "integer"
},
{
"name": "AcceptanceTaskRequestBody",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/TaskAcceptanceTaskRequestBody"
}
}
],
"responses": {
"200": {
"description": "OK response.",
"schema": {
"$ref": "#/definitions/TaskAcceptanceTaskResponseBody"
}
}
},
"schemes": [
"http"
]
}
},
"/tasks/{taskId}/apply-complete": {
"post": {
"tags": [
"task"
],
"summary": "申请完成任务",
"description": "申请完成任务",
"operationId": "task#applyCompleteTask",
"parameters": [
{
"name": "taskId",
"in": "path",
"description": "任务ID",
"required": true,
"type": "integer"
},
{
"name": "ApplyCompleteTaskRequestBody",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/TaskApplyCompleteTaskRequestBody"
}
}
],
"responses": {
"200": {
"description": "OK response.",
"schema": {
"$ref": "#/definitions/TaskApplyCompleteTaskResponseBody"
}
}
},
"schemes": [
"http"
]
}
},
"/tasks/{taskId}/bid": {
"post": {
"tags": [
"task"
],
"summary": "对任务进行竞标",
"description": "对任务进行竞标",
"operationId": "task#bidTask",
"parameters": [
{
"name": "taskId",
"in": "path",
"description": "任务ID",
"required": true,
"type": "integer"
},
{
"name": "BidTaskRequestBody",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/TaskBidTaskRequestBody"
}
}
],
"responses": {
"200": {
"description": "OK response.",
"schema": {
"$ref": "#/definitions/TaskBidTaskResponseBody"
}
}
},
"schemes": [
"http"
]
}
},
"/tasks/{taskId}/choose-successful-bidder": {
"post": {
"tags": [
"task"
],
"summary": "选择竞标任务的中标人",
"description": "选择竞标任务的中标人",
"operationId": "task#chooseSuccessfulBidder",
"parameters": [
{
"name": "taskId",
"in": "path",
"description": "任务ID",
"required": true,
"type": "integer"
},
{
"name": "ChooseSuccessfulBidderRequestBody",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/TaskChooseSuccessfulBidderRequestBody"
}
}
],
"responses": {
"200": {
"description": "OK response.",
"schema": {
"$ref": "#/definitions/TaskChooseSuccessfulBidderResponseBody"
}
}
},
"schemes": [
"http"
]
}
},
"/tasks/{taskId}/dff": {
"post": {
"tags": [
"task"
],
"summary": "关闭任务",
"description": "关闭任务",
"operationId": "task#offTask",
"parameters": [
{
"name": "taskId",
"in": "path",
"description": "任务ID",
"required": true,
"type": "integer"
},
{
"name": "OffTaskRequestBody",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/TaskOffTaskRequestBody"
}
}
],
"responses": {
"200": {
"description": "OK response.",
"schema": {
"$ref": "#/definitions/TaskOffTaskResponseBody"
}
}
},
"schemes": [
"http"
]
}
},
"/tasks/{taskId}/release": {
"post": {
"tags": [
"task"
],
"summary": "发布任务",
"description": "发布任务",
"operationId": "task#releaseTask",
"parameters": [
{
"name": "taskId",
... ... @@ -662,146 +1066,615 @@
"required": true,
"type": "integer"
},
{
"name": "RobTaskRequestBody",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/TaskRobTaskRequestBody"
{
"name": "ReleaseTaskRequestBody",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/TaskReleaseTaskRequestBody"
}
}
],
"responses": {
"200": {
"description": "OK response.",
"schema": {
"$ref": "#/definitions/TaskReleaseTaskResponseBody"
}
}
},
"schemes": [
"http"
]
}
},
"/tasks/{taskId}/rob": {
"post": {
"tags": [
"task"
],
"summary": "对任务进行抢单",
"description": "对任务进行抢单",
"operationId": "task#robTask",
"parameters": [
{
"name": "taskId",
"in": "path",
"description": "任务ID",
"required": true,
"type": "integer"
},
{
"name": "RobTaskRequestBody",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/TaskRobTaskRequestBody"
}
}
],
"responses": {
"200": {
"description": "OK response.",
"schema": {
"$ref": "#/definitions/TaskRobTaskResponseBody"
}
}
},
"schemes": [
"http"
]
}
},
"/tasks/search": {
"post": {
"tags": [
"task"
],
"summary": "搜索任务",
"description": "搜索任务",
"operationId": "task#searchTask",
"parameters": [
{
"name": "SearchTaskRequestBody",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/TaskSearchTaskRequestBody"
}
}
],
"responses": {
"200": {
"description": "OK response.",
"schema": {
"$ref": "#/definitions/TaskSearchTaskResponseBody"
}
}
},
"schemes": [
"http"
]
}
},
"/tasks/search-off-task-record": {
"post": {
"tags": [
"task"
],
"summary": "搜索关闭任务记录",
"description": "搜索关闭任务记录",
"operationId": "task#searchOffTaskRecord",
"parameters": [
{
"name": "SearchOffTaskRecordRequestBody",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/TaskSearchOffTaskRecordRequestBody"
}
}
],
"responses": {
"200": {
"description": "OK response.",
"schema": {
"$ref": "#/definitions/TaskSearchOffTaskRecordResponseBody"
}
}
},
"schemes": [
"http"
]
}
}
},
"definitions": {
"ConfigListBidTimeMatchResponseBody": {
"title": "Mediatype identifier: ConfigListBidTimeMatchResponseBody",
"type": "object",
"properties": {
"bidTimeMatchs": {
"type": "array",
"items": {
"$ref": "#/definitions/configResponseBody"
}
}
}
},
"ConfigListCustomerValueResponseBody": {
"title": "Mediatype identifier: ConfigListCustomerValueResponseBody",
"type": "object",
"properties": {
"customerValues": {
"type": "array",
"items": {
"$ref": "#/definitions/configResponseBody"
}
}
}
},
"ConfigListEmployeePermissionResponseBody": {
"title": "Mediatype identifier: ConfigListEmployeePermissionResponseBody",
"type": "object",
"properties": {
"employeePermissions": {
"type": "array",
"items": {
"$ref": "#/definitions/configResponseBody"
}
}
}
},
"ConfigListReferenceResourceTypeResponseBody": {
"title": "Mediatype identifier: ConfigListReferenceResourceTypeResponseBody",
"type": "object",
"properties": {
"referenceResourceTypes": {
"type": "array",
"items": {
"$ref": "#/definitions/configResponseBody"
}
}
}
},
"ConfigListTaskNatureResponseBody": {
"title": "Mediatype identifier: ConfigListTaskNatureResponseBody",
"type": "object",
"properties": {
"taskNatures": {
"type": "array",
"items": {
"$ref": "#/definitions/configResponseBody"
}
}
}
},
"ConfigListTaskStatusResponseBody": {
"title": "Mediatype identifier: ConfigListTaskStatusResponseBody",
"type": "object",
"properties": {
"taskStatuses": {
"type": "array",
"items": {
"$ref": "#/definitions/configResponseBody"
}
}
}
},
"ConfigListTaskTypeResponseBody": {
"title": "Mediatype identifier: ConfigListTaskTypeResponseBody",
"type": "object",
"properties": {
"taskTypes": {
"type": "array",
"items": {
"$ref": "#/definitions/configResponseBody"
}
}
}
},
"EmployeeCreateEmployeeRequestBody": {
"title": "EmployeeCreateEmployeeRequestBody",
"type": "object",
"properties": {
"employeeAccount": {
"type": "string",
"description": "员工账号"
},
"employeeAvatarUrl": {
"type": "string",
"description": "员工头像URL"
},
"employeeName": {
"type": "string",
"description": "员工姓名"
},
"uid": {
"type": "integer",
"description": "统一用户UID",
"required": [
"uid"
]
}
}
},
"EmployeeCreateEmployeeResponseBody": {
"title": "Mediatype identifier: EmployeeCreateEmployeeResponseBody",
"type": "object",
"properties": {
"employee": {
"$ref": "#/definitions/employeeResponseBody"
}
}
},
"EmployeeGetEmployeeResponseBody": {
"title": "Mediatype identifier: EmployeeGetEmployeeResponseBody",
"type": "object",
"properties": {
"employee": {
"$ref": "#/definitions/employeeResponseBody"
}
}
},
"EmployeeListEmployeeResponseBody": {
"title": "Mediatype identifier: EmployeeListEmployeeResponseBody",
"type": "object",
"properties": {
"count": {
"type": "integer",
"description": "结果总数",
"format": "int64"
},
"employees": {
"type": "array",
"items": {
"$ref": "#/definitions/employeeResponseBody"
}
}
}
},
"EmployeeRemoveEmployeeResponseBody": {
"title": "Mediatype identifier: EmployeeRemoveEmployeeResponseBody",
"type": "object",
"properties": {
"employee": {
"$ref": "#/definitions/employeeResponseBody"
}
}
},
"EmployeeUpdateEmployeeRequestBody": {
"title": "EmployeeUpdateEmployeeRequestBody",
"type": "object",
"properties": {
"employeeAccount": {
"type": "string",
"description": "员工账号"
},
"employeeAvatarUrl": {
"type": "string",
"description": "员工头像URL"
},
"employeeName": {
"type": "string",
"description": "员工姓名"
},
"permissions": {
"type": "array",
"items": {
"type": "integer",
"format": "int64"
},
"description": "员工权限集合"
}
}
},
"EmployeeUpdateEmployeeResponseBody": {
"title": "Mediatype identifier: EmployeeUpdateEmployeeResponseBody",
"type": "object",
"properties": {
"employee": {
"$ref": "#/definitions/employeeResponseBody"
}
}
},
"OffTaskRecordGetOffTaskRecordResponseBody": {
"title": "Mediatype identifier: OffTaskRecordGetOffTaskRecordResponseBody",
"type": "object",
"properties": {
"offTaskRecord": {
"$ref": "#/definitions/offTaskRecordResponseBody"
}
}
},
"OffTaskRecordSearchOffTaskRecordRequestBody": {
"title": "OffTaskRecordSearchOffTaskRecordRequestBody",
"type": "object",
"properties": {
"companyId": {
"type": "integer",
"description": "公司ID",
"required": [
"companyId"
]
},
"customerValue": {
"type": "array",
"items": {
"type": "string"
},
"description": "客户价值"
},
"limit": {
"type": "integer",
"description": "查询限制",
"format": "int64"
},
"offEndTime": {
"type": "string",
"description": "关闭任务时间区间-截止时间",
"format": "datetime"
},
"offStartTime": {
"type": "string",
"description": "关闭任务时间区间-开始时间",
"format": "datetime"
},
"offset": {
"type": "integer",
"description": "查询偏离量",
"format": "int64"
},
"taskContentMatch": {
"type": "string",
"description": "任务内容匹配"
},
"taskNature": {
"type": "string",
"description": "任务性质"
},
"taskType": {
"type": "integer",
"description": "任务类型",
"format": "int64"
}
}
},
"OffTaskRecordSearchOffTaskRecordResponseBody": {
"title": "Mediatype identifier: OffTaskRecordSearchOffTaskRecordResponseBody",
"type": "object",
"properties": {
"count": {
"type": "integer",
"description": "结果总数",
"format": "int64"
},
"offTaskRecords": {
"type": "array",
"items": {
"$ref": "#/definitions/offTaskRecordResponseBody"
}
}
}
},
"StatisticsPersonSuMoneyStatisticsRequestBody": {
"title": "StatisticsPersonSuMoneyStatisticsRequestBody",
"type": "object",
"properties": {
"uid": {
"type": "integer",
"description": "统一用户UID",
"required": [
"uid"
]
}
}
],
"responses": {
"200": {
"description": "OK response.",
"schema": {
"$ref": "#/definitions/TaskRobTaskResponseBody"
},
"StatisticsPersonSuMoneyStatisticsResponseBody": {
"title": "Mediatype identifier: StatisticsPersonSuMoneyStatisticsResponseBody",
"type": "object",
"properties": {
"personSuMoneyStatistics": {
"$ref": "#/definitions/personSuMoneyStatisticsResponseBody"
}
}
},
"schemes": [
"http"
"StatisticsPersonTaskStatisticsRequestBody": {
"title": "StatisticsPersonTaskStatisticsRequestBody",
"type": "object",
"properties": {
"uid": {
"type": "integer",
"description": "统一用户UID",
"required": [
"uid"
]
}
}
},
"/tasks/search": {
"post": {
"tags": [
"task"
],
"summary": "搜索任务",
"description": "搜索任务",
"operationId": "task#searchTask",
"parameters": [
{
"name": "SearchTaskRequestBody",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/TaskSearchTaskRequestBody"
"StatisticsPersonTaskStatisticsResponseBody": {
"title": "Mediatype identifier: StatisticsPersonTaskStatisticsResponseBody",
"type": "object",
"properties": {
"personTaskStatistics": {
"$ref": "#/definitions/personTaskStatisticsResponseBody"
}
}
],
"responses": {
"200": {
"description": "OK response.",
"schema": {
"$ref": "#/definitions/TaskSearchTaskResponseBody"
},
"StatisticsSystemTaskStatisticsRequestBody": {
"title": "StatisticsSystemTaskStatisticsRequestBody",
"type": "object",
"properties": {
"companyId": {
"type": "integer",
"description": "公司ID",
"required": [
"companyId"
]
}
}
},
"schemes": [
"http"
]
"StatisticsSystemTaskStatisticsResponseBody": {
"title": "Mediatype identifier: StatisticsSystemTaskStatisticsResponseBody",
"type": "object",
"properties": {
"systemTaskStatistics": {
"$ref": "#/definitions/systemTaskStatisticsResponseBody"
}
}
},
"definitions": {
"EmployeeCreateEmployeeRequestBody": {
"title": "EmployeeCreateEmployeeRequestBody",
"SuMoneyExchangeSuMoneyRequestBody": {
"title": "SuMoneyExchangeSuMoneyRequestBody",
"type": "object",
"properties": {
"employeeAccount": {
"exchangeDescription": {
"type": "string",
"description": "员工账号"
"description": "兑换描述",
"required": [
"exchangeDescription"
]
},
"employeeName": {
"type": "string",
"description": "员工姓名"
"operator": {
"type": "integer",
"description": "操作人UID",
"format": "int64"
},
"suMoney": {
"type": "number",
"description": "素币值",
"required": [
"suMoney"
]
},
"uid": {
"type": "integer",
"description": "统一用户UID",
"description": "兑换人UID",
"required": [
"uid"
]
}
}
},
"EmployeeCreateEmployeeResponseBody": {
"title": "Mediatype identifier: EmployeeCreateEmployeeResponseBody",
"SuMoneyExchangeSuMoneyResponseBody": {
"title": "Mediatype identifier: SuMoneyExchangeSuMoneyResponseBody",
"type": "object",
"properties": {
"employee": {
"$ref": "#/definitions/employeeResponseBody"
"suMoneyTransactionRecord": {
"$ref": "#/definitions/suMoneyTransactionRecordResponseBody"
}
}
},
"EmployeeGetEmployeeResponseBody": {
"title": "Mediatype identifier: EmployeeGetEmployeeResponseBody",
"SuMoneyGetSuMoneyTransactionRecordResponseBody": {
"title": "Mediatype identifier: SuMoneyGetSuMoneyTransactionRecordResponseBody",
"type": "object",
"properties": {
"employee": {
"$ref": "#/definitions/employeeResponseBody"
"suMoneyTransactionRecord": {
"$ref": "#/definitions/suMoneyTransactionRecordResponseBody"
}
}
},
"EmployeeListEmployeeResponseBody": {
"title": "Mediatype identifier: EmployeeListEmployeeResponseBody",
"SuMoneySearchSuMoneyTransactionRecordRequestBody": {
"title": "SuMoneySearchSuMoneyTransactionRecordRequestBody",
"type": "object",
"properties": {
"count": {
"limit": {
"type": "integer",
"description": "结果总数",
"description": "查询限制",
"format": "int64"
},
"employees": {
"type": "array",
"items": {
"$ref": "#/definitions/employeeResponseBody"
}
"offset": {
"type": "integer",
"description": "查询偏离量",
"format": "int64"
},
"operator": {
"type": "integer",
"description": "操作人UID",
"format": "int64"
},
"recordType": {
"type": "integer",
"description": "记录类型(1兑换,2任务奖励)",
"required": [
"recordType"
]
},
"transactionEndTime": {
"type": "string",
"description": "事务时间区间-截止时间",
"format": "datetime"
},
"transactionStartTime": {
"type": "string",
"description": "事务时间区间-开始时间",
"format": "datetime"
},
"uid": {
"type": "integer",
"description": "统一用户UID",
"required": [
"uid"
]
}
}
},
"EmployeeRemoveEmployeeResponseBody": {
"title": "Mediatype identifier: EmployeeRemoveEmployeeResponseBody",
"SuMoneySearchSuMoneyTransactionRecordResponseBody": {
"title": "Mediatype identifier: SuMoneySearchSuMoneyTransactionRecordResponseBody",
"type": "object",
"properties": {
"employee": {
"$ref": "#/definitions/employeeResponseBody"
"count": {
"type": "integer",
"description": "结果总数",
"format": "int64"
},
"suMoneyTransactionRecords": {
"type": "array",
"items": {
"$ref": "#/definitions/suMoneyTransactionRecordResponseBody"
}
}
}
},
"EmployeeUpdateEmployeeRequestBody": {
"title": "EmployeeUpdateEmployeeRequestBody",
"SuMoneySuMoneyTransactionRecordStatisticsRequestBody": {
"title": "SuMoneySuMoneyTransactionRecordStatisticsRequestBody",
"type": "object",
"properties": {
"employeeAccount": {
"transactionEndTime": {
"type": "string",
"description": "员工账号"
"description": "事务时间区间-截止时间",
"format": "datetime"
},
"employeeName": {
"transactionStartTime": {
"type": "string",
"description": "员工姓名"
"description": "事务时间区间-开始时间",
"format": "datetime"
},
"uid": {
"type": "integer",
"description": "统一用户UID",
"required": [
"uid"
]
}
}
},
"EmployeeUpdateEmployeeResponseBody": {
"title": "Mediatype identifier: EmployeeUpdateEmployeeResponseBody",
"SuMoneySuMoneyTransactionRecordStatisticsResponseBody": {
"title": "Mediatype identifier: SuMoneySuMoneyTransactionRecordStatisticsResponseBody",
"type": "object",
"properties": {
"employee": {
"$ref": "#/definitions/employeeResponseBody"
"expendSuMoney": {
"type": "number",
"description": "支出素币",
"required": [
"expendSuMoney"
]
},
"incomeSuMoney": {
"type": "number",
"description": "收入素币",
"required": [
"incomeSuMoney"
]
}
}
},
... ... @@ -824,6 +1697,13 @@
},
"description": "任务参与者UID列表"
},
"referenceResourceScore": {
"type": "array",
"items": {
"$ref": "#/definitions/referenceResourceItemRequestBody"
},
"description": "引用资源解决分"
},
"solvePictureUrls": {
"type": "array",
"items": {
... ... @@ -950,6 +1830,13 @@
"description": "竞标开始时间",
"format": "datetime"
},
"companyId": {
"type": "integer",
"description": "公司ID",
"required": [
"companyId"
]
},
"customerValue": {
"type": "array",
"items": {
... ... @@ -1133,6 +2020,76 @@
}
}
},
"TaskSearchOffTaskRecordRequestBody": {
"title": "TaskSearchOffTaskRecordRequestBody",
"type": "object",
"properties": {
"companyId": {
"type": "integer",
"description": "公司ID",
"required": [
"companyId"
]
},
"customerValue": {
"type": "array",
"items": {
"type": "string"
},
"description": "客户价值"
},
"limit": {
"type": "integer",
"description": "查询限制",
"format": "int64"
},
"offEndTime": {
"type": "string",
"description": "关闭任务时间区间-截止时间",
"format": "datetime"
},
"offStartTime": {
"type": "string",
"description": "关闭任务时间区间-开始时间",
"format": "datetime"
},
"offset": {
"type": "integer",
"description": "查询偏离量",
"format": "int64"
},
"taskContentMatch": {
"type": "string",
"description": "任务内容匹配"
},
"taskNature": {
"type": "string",
"description": "任务性质"
},
"taskType": {
"type": "integer",
"description": "任务类型",
"format": "int64"
}
}
},
"TaskSearchOffTaskRecordResponseBody": {
"title": "Mediatype identifier: TaskSearchOffTaskRecordResponseBody",
"type": "object",
"properties": {
"count": {
"type": "integer",
"description": "结果总数",
"format": "int64"
},
"offTaskRecords": {
"type": "array",
"items": {
"$ref": "#/definitions/offTaskRecordResponseBody"
}
}
}
},
"TaskSearchTaskRequestBody": {
"title": "TaskSearchTaskRequestBody",
"type": "object",
... ... @@ -1142,6 +2099,11 @@
"description": "竞标时间(1全部,2已截止,3未截止)",
"format": "int64"
},
"bidder": {
"type": "integer",
"description": "竞标参与者UID",
"format": "int64"
},
"companyId": {
"type": "integer",
"description": "公司ID",
... ... @@ -1150,9 +2112,20 @@
]
},
"customerValue": {
"type": "string",
"type": "array",
"items": {
"type": "string"
},
"description": "客户价值"
},
"isFilterCloseStatus": {
"type": "boolean",
"description": "是否过滤关闭状态任务"
},
"isFilterUnReleasedStatus": {
"type": "boolean",
"description": "是否过滤待发布状态任务"
},
"isRewardTake": {
"type": "boolean",
"description": "是否悬赏任务"
... ... @@ -1169,17 +2142,17 @@
},
"participator": {
"type": "integer",
"description": "任务参与者",
"description": "任务参与者UID",
"format": "int64"
},
"receiver": {
"type": "integer",
"description": "任务领取人",
"description": "任务领取人UID",
"format": "int64"
},
"sponsor": {
"type": "integer",
"description": "任务发起者",
"description": "任务发起者UID",
"format": "int64"
},
"taskContentMatch": {
... ... @@ -1341,6 +2314,27 @@
},
"description": "竞标人员信息"
},
"configResponseBody": {
"title": "configResponseBody",
"type": "object",
"properties": {
"id": {
"type": "integer",
"description": "ID",
"required": [
"id"
]
},
"name": {
"type": "string",
"description": "名称",
"required": [
"name"
]
}
},
"description": "配置字典"
},
"employeeInfoRequestBody": {
"title": "employeeInfoRequestBody",
"type": "object",
... ... @@ -1349,6 +2343,10 @@
"type": "string",
"description": "员工账号"
},
"employeeAvatarUrl": {
"type": "string",
"description": "员工头像URL"
},
"employeeName": {
"type": "string",
"description": "员工姓名",
... ... @@ -1374,6 +2372,10 @@
"type": "string",
"description": "员工账号"
},
"employeeAvatarUrl": {
"type": "string",
"description": "员工头像URL"
},
"employeeName": {
"type": "string",
"description": "员工姓名",
... ... @@ -1412,6 +2414,17 @@
"employeeInfo": {
"$ref": "#/definitions/employeeInfoResponseBody"
},
"permissions": {
"type": "array",
"items": {
"type": "integer",
"format": "int64"
},
"description": "员工权限集合",
"required": [
"permissions"
]
},
"status": {
"type": "integer",
"description": "员工状态(启用或者禁用)",
... ... @@ -1427,10 +2440,161 @@
},
"description": "员工"
},
"offTaskRecordResponseBody": {
"title": "offTaskRecordResponseBody",
"type": "object",
"properties": {
"createTime": {
"type": "string",
"description": "创建时间",
"required": [
"createTime"
]
},
"offReason": {
"type": "string",
"description": "关闭理由",
"required": [
"offReason"
]
},
"offTaskRecordId": {
"type": "integer",
"description": "关闭任务记录ID",
"required": [
"offTaskRecordId"
]
},
"operator": {
"$ref": "#/definitions/employeeInfoResponseBody"
},
"task": {
"$ref": "#/definitions/taskResponseBody"
}
},
"description": "关闭任务记录"
},
"personSuMoneyStatisticsResponseBody": {
"title": "personSuMoneyStatisticsResponseBody",
"type": "object",
"properties": {
"currentSuMoney": {
"type": "number",
"description": "当前素币",
"required": [
"currentSuMoney"
]
},
"incomeSuMoneyOfYesterday": {
"type": "number",
"description": "昨日收益",
"required": [
"incomeSuMoneyOfYesterday"
]
}
},
"description": "个人素币统计"
},
"personTaskStatisticsResponseBody": {
"title": "personTaskStatisticsResponseBody",
"type": "object",
"properties": {
"bidAsParticipator": {
"type": "integer",
"description": "个人参与的竞标中任务",
"required": [
"bidAsParticipator"
]
},
"completedAsParticipator": {
"type": "integer",
"description": "个人参与的已完成任务",
"required": [
"completedAsParticipator"
]
},
"completedAsReceiver": {
"type": "integer",
"description": "个人领取的已完成任务",
"required": [
"completedAsReceiver"
]
},
"completedAsSponsor": {
"type": "integer",
"description": "个人发起的已完成任务",
"required": [
"completedAsSponsor"
]
},
"unAcceptanceAsReceiver": {
"type": "integer",
"description": "个人领取的待验收任务",
"required": [
"unAcceptanceAsReceiver"
]
},
"unAcceptanceAsSponsor": {
"type": "integer",
"description": "个人发起的待验收任务",
"required": [
"unAcceptanceAsSponsor"
]
},
"unClaimedAsSponsor": {
"type": "integer",
"description": "个人发起的待领取任务",
"required": [
"unClaimedAsSponsor"
]
},
"unReleasedAsSponsor": {
"type": "integer",
"description": "个人发起的待发布任务",
"required": [
"unReleasedAsSponsor"
]
},
"underwayAsReceiver": {
"type": "integer",
"description": "个人领取的进行中任务",
"required": [
"underwayAsReceiver"
]
},
"underwayAsSponsor": {
"type": "integer",
"description": "个人发起的进行中任务",
"required": [
"underwayAsSponsor"
]
}
},
"description": "个人任务统计"
},
"referenceResourceItemRequestBody": {
"title": "referenceResourceItemRequestBody",
"type": "object",
"properties": {
"content": {
"type": "string",
"description": "内容",
"required": [
"content"
]
},
"issueScore": {
"type": "number",
"description": "问题总分",
"format": "double"
},
"referenceResourceId": {
"type": "integer",
"description": "引用资源ID",
"required": [
"referenceResourceId"
]
},
"serialNumber": {
"type": "integer",
"description": "编号",
... ... @@ -1438,6 +2602,13 @@
"serialNumber"
]
},
"solveScore": {
"type": "array",
"items": {
"$ref": "#/definitions/solveScoreItemRequestBody"
},
"description": "解决评分明细"
},
"title": {
"type": "string",
"description": "标题",
... ... @@ -1452,6 +2623,25 @@
"title": "referenceResourceItemResponseBody",
"type": "object",
"properties": {
"content": {
"type": "string",
"description": "内容",
"required": [
"content"
]
},
"issueScore": {
"type": "number",
"description": "问题总分",
"format": "double"
},
"referenceResourceId": {
"type": "integer",
"description": "引用资源ID",
"required": [
"referenceResourceId"
]
},
"serialNumber": {
"type": "integer",
"description": "编号",
... ... @@ -1459,6 +2649,13 @@
"serialNumber"
]
},
"solveScore": {
"type": "array",
"items": {
"$ref": "#/definitions/solveScoreItemResponseBody"
},
"description": "解决评分明细"
},
"title": {
"type": "string",
"description": "标题",
... ... @@ -1534,6 +2731,147 @@
},
"description": "抢单任务信息"
},
"solveScoreItemRequestBody": {
"title": "solveScoreItemRequestBody",
"type": "object",
"properties": {
"contributor": {
"$ref": "#/definitions/employeeInfoRequestBody"
},
"isReceiver": {
"type": "boolean",
"description": "是否领取人",
"required": [
"isReceiver"
]
},
"percentage": {
"type": "integer",
"description": "解决占比",
"required": [
"percentage"
]
},
"score": {
"type": "number",
"description": "解决评分",
"required": [
"score"
]
}
},
"description": "解决评分项"
},
"solveScoreItemResponseBody": {
"title": "solveScoreItemResponseBody",
"type": "object",
"properties": {
"contributor": {
"$ref": "#/definitions/employeeInfoResponseBody"
},
"isReceiver": {
"type": "boolean",
"description": "是否领取人",
"required": [
"isReceiver"
]
},
"percentage": {
"type": "integer",
"description": "解决占比",
"required": [
"percentage"
]
},
"score": {
"type": "number",
"description": "解决评分",
"required": [
"score"
]
}
},
"description": "解决评分项"
},
"suMoneyTransactionRecordResponseBody": {
"title": "suMoneyTransactionRecordResponseBody",
"type": "object",
"properties": {
"createTime": {
"type": "string",
"description": "创建时间",
"required": [
"createTime"
]
},
"employee": {
"$ref": "#/definitions/employeeInfoResponseBody"
},
"operator": {
"$ref": "#/definitions/employeeInfoResponseBody"
},
"recordDescription": {
"type": "string",
"description": "素币事务记录描述",
"required": [
"recordDescription"
]
},
"recordType": {
"type": "integer",
"description": "记录类型(1兑换,2任务奖励)",
"required": [
"recordType"
]
},
"suMoney": {
"type": "number",
"description": "事务素币值",
"required": [
"suMoney"
]
},
"suMoneyBeforeTransaction": {
"type": "number",
"description": "事务处理前素币值",
"required": [
"suMoneyBeforeTransaction"
]
},
"suMoneyTransactionRecordId": {
"type": "integer",
"description": "素币事务记录ID",
"required": [
"suMoneyTransactionRecordId"
]
}
},
"description": "素币事务记录"
},
"systemTaskStatisticsResponseBody": {
"title": "systemTaskStatisticsResponseBody",
"type": "object",
"properties": {
"completed": {
"type": "integer",
"description": "系统已完成任务",
"format": "int64"
},
"released": {
"type": "integer",
"description": "系统已发布任务",
"required": [
"released"
]
},
"underway": {
"type": "integer",
"description": "系统进行中任务",
"format": "int64"
}
},
"description": "系统任务统计"
},
"taskPercentageItemRequestBody": {
"title": "taskPercentageItemRequestBody",
"type": "object",
... ... @@ -1541,12 +2879,26 @@
"contributor": {
"$ref": "#/definitions/employeeInfoRequestBody"
},
"isReceiver": {
"type": "boolean",
"description": "是否领取人",
"required": [
"isReceiver"
]
},
"percentage": {
"type": "integer",
"description": "任务贡献占比",
"required": [
"percentage"
]
},
"suMoney": {
"type": "number",
"description": "分配到的奖励素币",
"required": [
"suMoney"
]
}
},
"description": "任务贡献占比项"
... ... @@ -1558,12 +2910,26 @@
"contributor": {
"$ref": "#/definitions/employeeInfoResponseBody"
},
"isReceiver": {
"type": "boolean",
"description": "是否领取人",
"required": [
"isReceiver"
]
},
"percentage": {
"type": "integer",
"description": "任务贡献占比",
"required": [
"percentage"
]
},
"suMoney": {
"type": "number",
"description": "分配到的奖励素币",
"required": [
"suMoney"
]
}
},
"description": "任务贡献占比项"
... ...
... ... @@ -5,7 +5,6 @@ info:
contact:
name: linmadan
email: 772181827@qq.com
home: www.madannet.com
version: 0.0.1
consumes:
- application/json
... ... @@ -14,6 +13,104 @@ produces:
- application/json
- application/xml
paths:
/config/bid-time-matchs:
get:
tags:
- config
summary: 返回竞标时间字典列表(1全部,2已截止,3未截止)
description: 返回竞标时间字典列表(1全部,2已截止,3未截止)
operationId: config#listBidTimeMatch
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/ConfigListBidTimeMatchResponseBody'
schemes:
- http
/config/customer-values:
get:
tags:
- config
summary: 返回客户价值字典列表
description: 返回客户价值字典列表
operationId: config#listCustomerValue
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/ConfigListCustomerValueResponseBody'
schemes:
- http
/config/employee-permissions:
get:
tags:
- config
summary: 返回员工权限字典列表(1任务管理,2素币管理,3成员管理)
description: 返回员工权限字典列表(1任务管理,2素币管理,3成员管理)
operationId: config#listEmployeePermission
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/ConfigListEmployeePermissionResponseBody'
schemes:
- http
/config/reference-resource-types:
get:
tags:
- config
summary: 返回任务引用资源类型字典列表
description: 返回任务引用资源类型字典列表
operationId: config#listReferenceResourceType
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/ConfigListReferenceResourceTypeResponseBody'
schemes:
- http
/config/task-natures:
get:
tags:
- config
summary: 返回任务性质字典列表
description: 返回任务性质字典列表
operationId: config#listTaskNature
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/ConfigListTaskNatureResponseBody'
schemes:
- http
/config/task-statuses:
get:
tags:
- config
summary: 返回任务状态字典列表
description: 返回任务状态字典列表
operationId: config#listTaskStatus
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/ConfigListTaskStatusResponseBody'
schemes:
- http
/config/task-types:
get:
tags:
- config
summary: 返回任务类型字典列表
description: 返回任务类型字典列表
operationId: config#listTaskType
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/ConfigListTaskTypeResponseBody'
schemes:
- http
/employees:
get:
tags:
... ... @@ -22,6 +119,16 @@ paths:
description: 返回员工列表
operationId: employee#listEmployee
parameters:
- name: companyId
in: query
description: 公司ID
required: false
type: integer
- name: employeeNameMatch
in: query
description: 员工姓名匹配
required: false
type: string
- name: offset
in: query
description: 查询偏离量
... ... @@ -121,6 +228,186 @@ paths:
$ref: '#/definitions/EmployeeRemoveEmployeeResponseBody'
schemes:
- http
/off-task-records/{offTaskRecordId}:
get:
tags:
- offTaskRecord
summary: 返回关闭任务记录
description: 返回关闭任务记录
operationId: offTaskRecord#getOffTaskRecord
parameters:
- name: offTaskRecordId
in: path
description: 关闭任务记录ID
required: true
type: integer
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/OffTaskRecordGetOffTaskRecordResponseBody'
schemes:
- http
/off-task-records/search-off-task-record:
post:
tags:
- offTaskRecord
summary: 搜索关闭任务记录
description: 搜索关闭任务记录
operationId: offTaskRecord#searchOffTaskRecord
parameters:
- name: SearchOffTaskRecordRequestBody
in: body
required: true
schema:
$ref: '#/definitions/OffTaskRecordSearchOffTaskRecordRequestBody'
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/OffTaskRecordSearchOffTaskRecordResponseBody'
schemes:
- http
/statistics/person-su-money:
post:
tags:
- statistics
summary: 获取个人素币统计
description: 获取个人素币统计
operationId: statistics#personSuMoneyStatistics
parameters:
- name: PersonSuMoneyStatisticsRequestBody
in: body
required: true
schema:
$ref: '#/definitions/StatisticsPersonSuMoneyStatisticsRequestBody'
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/StatisticsPersonSuMoneyStatisticsResponseBody'
schemes:
- http
/statistics/person-task:
post:
tags:
- statistics
summary: 获取个人任务统计
description: 获取个人任务统计
operationId: statistics#personTaskStatistics
parameters:
- name: PersonTaskStatisticsRequestBody
in: body
required: true
schema:
$ref: '#/definitions/StatisticsPersonTaskStatisticsRequestBody'
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/StatisticsPersonTaskStatisticsResponseBody'
schemes:
- http
/statistics/system-task:
post:
tags:
- statistics
summary: 获取系统任务统计
description: 获取系统任务统计
operationId: statistics#systemTaskStatistics
parameters:
- name: SystemTaskStatisticsRequestBody
in: body
required: true
schema:
$ref: '#/definitions/StatisticsSystemTaskStatisticsRequestBody'
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/StatisticsSystemTaskStatisticsResponseBody'
schemes:
- http
/su-money/exchange:
post:
tags:
- suMoney
summary: 素币兑换
description: 素币兑换
operationId: suMoney#exchangeSuMoney
parameters:
- name: ExchangeSuMoneyRequestBody
in: body
required: true
schema:
$ref: '#/definitions/SuMoneyExchangeSuMoneyRequestBody'
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/SuMoneyExchangeSuMoneyResponseBody'
schemes:
- http
/su-money/search-su-money-transaction-record:
post:
tags:
- suMoney
summary: 搜索素币事务记录
description: 搜索素币事务记录
operationId: suMoney#searchSuMoneyTransactionRecord
parameters:
- name: SearchSuMoneyTransactionRecordRequestBody
in: body
required: true
schema:
$ref: '#/definitions/SuMoneySearchSuMoneyTransactionRecordRequestBody'
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/SuMoneySearchSuMoneyTransactionRecordResponseBody'
schemes:
- http
/su-money/su-money-transaction-record-statistics:
post:
tags:
- suMoney
summary: 素币事务记录统计
description: 素币事务记录统计
operationId: suMoney#suMoneyTransactionRecordStatistics
parameters:
- name: SuMoneyTransactionRecordStatisticsRequestBody
in: body
required: true
schema:
$ref: '#/definitions/SuMoneySuMoneyTransactionRecordStatisticsRequestBody'
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/SuMoneySuMoneyTransactionRecordStatisticsResponseBody'
schemes:
- http
/su-money/su-money-transaction-records/{suMoneyTransactionRecordId}:
get:
tags:
- suMoney
summary: 返回素币事务记录
description: 返回素币事务记录
operationId: suMoney#getSuMoneyTransactionRecord
parameters:
- name: suMoneyTransactionRecordId
in: path
description: 素币事务记录ID
required: true
type: integer
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/SuMoneyGetSuMoneyTransactionRecordResponseBody'
schemes:
- http
/tasks:
get:
tags:
... ... @@ -136,7 +423,7 @@ paths:
type: integer
- name: sponsor
in: query
description: 任务发起者
description: 任务发起者UID
required: false
type: integer
format: int64
... ... @@ -159,7 +446,10 @@ paths:
in: query
description: 客户价值
required: false
type: array
items:
type: string
collectionFormat: multi
- name: taskNature
in: query
description: 任务性质
... ... @@ -177,13 +467,13 @@ paths:
type: integer
- name: receiver
in: query
description: 任务领取人
description: 任务领取人UID
required: false
type: integer
format: int64
- name: participator
in: query
description: 任务参与者
description: 任务参与者UID
required: false
type: integer
format: int64
... ... @@ -481,68 +771,371 @@ paths:
$ref: '#/definitions/TaskSearchTaskResponseBody'
schemes:
- http
/tasks/search-off-task-record:
post:
tags:
- task
summary: 搜索关闭任务记录
description: 搜索关闭任务记录
operationId: task#searchOffTaskRecord
parameters:
- name: SearchOffTaskRecordRequestBody
in: body
required: true
schema:
$ref: '#/definitions/TaskSearchOffTaskRecordRequestBody'
responses:
"200":
description: OK response.
schema:
$ref: '#/definitions/TaskSearchOffTaskRecordResponseBody'
schemes:
- http
definitions:
ConfigListBidTimeMatchResponseBody:
title: 'Mediatype identifier: ConfigListBidTimeMatchResponseBody'
type: object
properties:
bidTimeMatchs:
type: array
items:
$ref: '#/definitions/configResponseBody'
ConfigListCustomerValueResponseBody:
title: 'Mediatype identifier: ConfigListCustomerValueResponseBody'
type: object
properties:
customerValues:
type: array
items:
$ref: '#/definitions/configResponseBody'
ConfigListEmployeePermissionResponseBody:
title: 'Mediatype identifier: ConfigListEmployeePermissionResponseBody'
type: object
properties:
employeePermissions:
type: array
items:
$ref: '#/definitions/configResponseBody'
ConfigListReferenceResourceTypeResponseBody:
title: 'Mediatype identifier: ConfigListReferenceResourceTypeResponseBody'
type: object
properties:
referenceResourceTypes:
type: array
items:
$ref: '#/definitions/configResponseBody'
ConfigListTaskNatureResponseBody:
title: 'Mediatype identifier: ConfigListTaskNatureResponseBody'
type: object
properties:
taskNatures:
type: array
items:
$ref: '#/definitions/configResponseBody'
ConfigListTaskStatusResponseBody:
title: 'Mediatype identifier: ConfigListTaskStatusResponseBody'
type: object
properties:
taskStatuses:
type: array
items:
$ref: '#/definitions/configResponseBody'
ConfigListTaskTypeResponseBody:
title: 'Mediatype identifier: ConfigListTaskTypeResponseBody'
type: object
properties:
taskTypes:
type: array
items:
$ref: '#/definitions/configResponseBody'
EmployeeCreateEmployeeRequestBody:
title: EmployeeCreateEmployeeRequestBody
type: object
properties:
employeeAccount:
type: string
description: 员工账号
employeeName:
description: 员工账号
employeeAvatarUrl:
type: string
description: 员工头像URL
employeeName:
type: string
description: 员工姓名
uid:
type: integer
description: 统一用户UID
required:
- uid
EmployeeCreateEmployeeResponseBody:
title: 'Mediatype identifier: EmployeeCreateEmployeeResponseBody'
type: object
properties:
employee:
$ref: '#/definitions/employeeResponseBody'
EmployeeGetEmployeeResponseBody:
title: 'Mediatype identifier: EmployeeGetEmployeeResponseBody'
type: object
properties:
employee:
$ref: '#/definitions/employeeResponseBody'
EmployeeListEmployeeResponseBody:
title: 'Mediatype identifier: EmployeeListEmployeeResponseBody'
type: object
properties:
count:
type: integer
description: 结果总数
format: int64
employees:
type: array
items:
$ref: '#/definitions/employeeResponseBody'
EmployeeRemoveEmployeeResponseBody:
title: 'Mediatype identifier: EmployeeRemoveEmployeeResponseBody'
type: object
properties:
employee:
$ref: '#/definitions/employeeResponseBody'
EmployeeUpdateEmployeeRequestBody:
title: EmployeeUpdateEmployeeRequestBody
type: object
properties:
employeeAccount:
type: string
description: 员工账号
employeeAvatarUrl:
type: string
description: 员工头像URL
employeeName:
type: string
description: 员工姓名
permissions:
type: array
items:
type: integer
format: int64
description: 员工权限集合
EmployeeUpdateEmployeeResponseBody:
title: 'Mediatype identifier: EmployeeUpdateEmployeeResponseBody'
type: object
properties:
employee:
$ref: '#/definitions/employeeResponseBody'
OffTaskRecordGetOffTaskRecordResponseBody:
title: 'Mediatype identifier: OffTaskRecordGetOffTaskRecordResponseBody'
type: object
properties:
offTaskRecord:
$ref: '#/definitions/offTaskRecordResponseBody'
OffTaskRecordSearchOffTaskRecordRequestBody:
title: OffTaskRecordSearchOffTaskRecordRequestBody
type: object
properties:
companyId:
type: integer
description: 公司ID
required:
- companyId
customerValue:
type: array
items:
type: string
description: 客户价值
limit:
type: integer
description: 查询限制
format: int64
offEndTime:
type: string
description: 关闭任务时间区间-截止时间
format: datetime
offStartTime:
type: string
description: 关闭任务时间区间-开始时间
format: datetime
offset:
type: integer
description: 查询偏离量
format: int64
taskContentMatch:
type: string
description: 任务内容匹配
taskNature:
type: string
description: 任务性质
taskType:
type: integer
description: 任务类型
format: int64
OffTaskRecordSearchOffTaskRecordResponseBody:
title: 'Mediatype identifier: OffTaskRecordSearchOffTaskRecordResponseBody'
type: object
properties:
count:
type: integer
description: 结果总数
format: int64
offTaskRecords:
type: array
items:
$ref: '#/definitions/offTaskRecordResponseBody'
StatisticsPersonSuMoneyStatisticsRequestBody:
title: StatisticsPersonSuMoneyStatisticsRequestBody
type: object
properties:
uid:
type: integer
description: 统一用户UID
required:
- uid
StatisticsPersonSuMoneyStatisticsResponseBody:
title: 'Mediatype identifier: StatisticsPersonSuMoneyStatisticsResponseBody'
type: object
properties:
personSuMoneyStatistics:
$ref: '#/definitions/personSuMoneyStatisticsResponseBody'
StatisticsPersonTaskStatisticsRequestBody:
title: StatisticsPersonTaskStatisticsRequestBody
type: object
properties:
uid:
type: integer
description: 统一用户UID
required:
- uid
StatisticsPersonTaskStatisticsResponseBody:
title: 'Mediatype identifier: StatisticsPersonTaskStatisticsResponseBody'
type: object
properties:
personTaskStatistics:
$ref: '#/definitions/personTaskStatisticsResponseBody'
StatisticsSystemTaskStatisticsRequestBody:
title: StatisticsSystemTaskStatisticsRequestBody
type: object
properties:
companyId:
type: integer
description: 公司ID
required:
- companyId
StatisticsSystemTaskStatisticsResponseBody:
title: 'Mediatype identifier: StatisticsSystemTaskStatisticsResponseBody'
type: object
properties:
systemTaskStatistics:
$ref: '#/definitions/systemTaskStatisticsResponseBody'
SuMoneyExchangeSuMoneyRequestBody:
title: SuMoneyExchangeSuMoneyRequestBody
type: object
properties:
exchangeDescription:
type: string
description: 兑换描述
required:
- exchangeDescription
operator:
type: integer
description: 操作人UID
format: int64
suMoney:
type: number
description: 素币值
required:
- suMoney
uid:
type: integer
description: 兑换人UID
required:
- uid
SuMoneyExchangeSuMoneyResponseBody:
title: 'Mediatype identifier: SuMoneyExchangeSuMoneyResponseBody'
type: object
properties:
suMoneyTransactionRecord:
$ref: '#/definitions/suMoneyTransactionRecordResponseBody'
SuMoneyGetSuMoneyTransactionRecordResponseBody:
title: 'Mediatype identifier: SuMoneyGetSuMoneyTransactionRecordResponseBody'
type: object
properties:
suMoneyTransactionRecord:
$ref: '#/definitions/suMoneyTransactionRecordResponseBody'
SuMoneySearchSuMoneyTransactionRecordRequestBody:
title: SuMoneySearchSuMoneyTransactionRecordRequestBody
type: object
properties:
limit:
type: integer
description: 查询限制
format: int64
offset:
type: integer
description: 查询偏离量
format: int64
operator:
type: integer
description: 操作人UID
format: int64
recordType:
type: integer
description: 记录类型(1兑换,2任务奖励)
required:
- recordType
transactionEndTime:
type: string
description: 事务时间区间-截止时间
format: datetime
transactionStartTime:
type: string
description: 员工姓名
description: 事务时间区间-开始时间
format: datetime
uid:
type: integer
description: 统一用户UID
required:
- uid
EmployeeCreateEmployeeResponseBody:
title: 'Mediatype identifier: EmployeeCreateEmployeeResponseBody'
type: object
properties:
employee:
$ref: '#/definitions/employeeResponseBody'
EmployeeGetEmployeeResponseBody:
title: 'Mediatype identifier: EmployeeGetEmployeeResponseBody'
type: object
properties:
employee:
$ref: '#/definitions/employeeResponseBody'
EmployeeListEmployeeResponseBody:
title: 'Mediatype identifier: EmployeeListEmployeeResponseBody'
SuMoneySearchSuMoneyTransactionRecordResponseBody:
title: 'Mediatype identifier: SuMoneySearchSuMoneyTransactionRecordResponseBody'
type: object
properties:
count:
type: integer
description: 结果总数
format: int64
employees:
suMoneyTransactionRecords:
type: array
items:
$ref: '#/definitions/employeeResponseBody'
EmployeeRemoveEmployeeResponseBody:
title: 'Mediatype identifier: EmployeeRemoveEmployeeResponseBody'
type: object
properties:
employee:
$ref: '#/definitions/employeeResponseBody'
EmployeeUpdateEmployeeRequestBody:
title: EmployeeUpdateEmployeeRequestBody
$ref: '#/definitions/suMoneyTransactionRecordResponseBody'
SuMoneySuMoneyTransactionRecordStatisticsRequestBody:
title: SuMoneySuMoneyTransactionRecordStatisticsRequestBody
type: object
properties:
employeeAccount:
transactionEndTime:
type: string
description: 员工账号
employeeName:
description: 事务时间区间-截止时间
format: datetime
transactionStartTime:
type: string
description: 员工姓名
EmployeeUpdateEmployeeResponseBody:
title: 'Mediatype identifier: EmployeeUpdateEmployeeResponseBody'
description: 事务时间区间-开始时间
format: datetime
uid:
type: integer
description: 统一用户UID
required:
- uid
SuMoneySuMoneyTransactionRecordStatisticsResponseBody:
title: 'Mediatype identifier: SuMoneySuMoneyTransactionRecordStatisticsResponseBody'
type: object
properties:
employee:
$ref: '#/definitions/employeeResponseBody'
expendSuMoney:
type: number
description: 支出素币
required:
- expendSuMoney
incomeSuMoney:
type: number
description: 收入素币
required:
- incomeSuMoney
TaskAcceptanceTaskRequestBody:
title: TaskAcceptanceTaskRequestBody
type: object
... ... @@ -558,6 +1151,11 @@ definitions:
type: integer
format: int64
description: 任务参与者UID列表
referenceResourceScore:
type: array
items:
$ref: '#/definitions/referenceResourceItemRequestBody'
description: 引用资源解决分
solvePictureUrls:
type: array
items:
... ... @@ -646,6 +1244,11 @@ definitions:
type: string
description: 竞标开始时间
format: datetime
companyId:
type: integer
description: 公司ID
required:
- companyId
customerValue:
type: array
items:
... ... @@ -772,6 +1375,58 @@ definitions:
properties:
task:
$ref: '#/definitions/taskResponseBody'
TaskSearchOffTaskRecordRequestBody:
title: TaskSearchOffTaskRecordRequestBody
type: object
properties:
companyId:
type: integer
description: 公司ID
required:
- companyId
customerValue:
type: array
items:
type: string
description: 客户价值
limit:
type: integer
description: 查询限制
format: int64
offEndTime:
type: string
description: 关闭任务时间区间-截止时间
format: datetime
offStartTime:
type: string
description: 关闭任务时间区间-开始时间
format: datetime
offset:
type: integer
description: 查询偏离量
format: int64
taskContentMatch:
type: string
description: 任务内容匹配
taskNature:
type: string
description: 任务性质
taskType:
type: integer
description: 任务类型
format: int64
TaskSearchOffTaskRecordResponseBody:
title: 'Mediatype identifier: TaskSearchOffTaskRecordResponseBody'
type: object
properties:
count:
type: integer
description: 结果总数
format: int64
offTaskRecords:
type: array
items:
$ref: '#/definitions/offTaskRecordResponseBody'
TaskSearchTaskRequestBody:
title: TaskSearchTaskRequestBody
type: object
... ... @@ -780,14 +1435,26 @@ definitions:
type: integer
description: 竞标时间(1全部,2已截止,3未截止)
format: int64
bidder:
type: integer
description: 竞标参与者UID
format: int64
companyId:
type: integer
description: 公司ID
required:
- companyId
customerValue:
type: array
items:
type: string
description: 客户价值
isFilterCloseStatus:
type: boolean
description: 是否过滤关闭状态任务
isFilterUnReleasedStatus:
type: boolean
description: 是否过滤待发布状态任务
isRewardTake:
type: boolean
description: 是否悬赏任务
... ... @@ -801,15 +1468,15 @@ definitions:
format: int64
participator:
type: integer
description: 任务参与者
description: 任务参与者UID
format: int64
receiver:
type: integer
description: 任务领取人
description: 任务领取人UID
format: int64
sponsor:
type: integer
description: 任务发起者
description: 任务发起者UID
format: int64
taskContentMatch:
type: string
... ... @@ -925,6 +1592,21 @@ definitions:
bidder:
$ref: '#/definitions/employeeInfoResponseBody'
description: 竞标人员信息
configResponseBody:
title: configResponseBody
type: object
properties:
id:
type: integer
description: ID
required:
- id
name:
type: string
description: 名称
required:
- name
description: 配置字典
employeeInfoRequestBody:
title: employeeInfoRequestBody
type: object
... ... @@ -932,6 +1614,9 @@ definitions:
employeeAccount:
type: string
description: 员工账号
employeeAvatarUrl:
type: string
description: 员工头像URL
employeeName:
type: string
description: 员工姓名
... ... @@ -950,6 +1635,9 @@ definitions:
employeeAccount:
type: string
description: 员工账号
employeeAvatarUrl:
type: string
description: 员工头像URL
employeeName:
type: string
description: 员工姓名
... ... @@ -977,6 +1665,14 @@ definitions:
- employeeId
employeeInfo:
$ref: '#/definitions/employeeInfoResponseBody'
permissions:
type: array
items:
type: integer
format: int64
description: 员工权限集合
required:
- permissions
status:
type: integer
description: 员工状态(启用或者禁用)
... ... @@ -987,15 +1683,128 @@ definitions:
required:
- suMoney
description: 员工
offTaskRecordResponseBody:
title: offTaskRecordResponseBody
type: object
properties:
createTime:
type: string
description: 创建时间
required:
- createTime
offReason:
type: string
description: 关闭理由
required:
- offReason
offTaskRecordId:
type: integer
description: 关闭任务记录ID
required:
- offTaskRecordId
operator:
$ref: '#/definitions/employeeInfoResponseBody'
task:
$ref: '#/definitions/taskResponseBody'
description: 关闭任务记录
personSuMoneyStatisticsResponseBody:
title: personSuMoneyStatisticsResponseBody
type: object
properties:
currentSuMoney:
type: number
description: 当前素币
required:
- currentSuMoney
incomeSuMoneyOfYesterday:
type: number
description: 昨日收益
required:
- incomeSuMoneyOfYesterday
description: 个人素币统计
personTaskStatisticsResponseBody:
title: personTaskStatisticsResponseBody
type: object
properties:
bidAsParticipator:
type: integer
description: 个人参与的竞标中任务
required:
- bidAsParticipator
completedAsParticipator:
type: integer
description: 个人参与的已完成任务
required:
- completedAsParticipator
completedAsReceiver:
type: integer
description: 个人领取的已完成任务
required:
- completedAsReceiver
completedAsSponsor:
type: integer
description: 个人发起的已完成任务
required:
- completedAsSponsor
unAcceptanceAsReceiver:
type: integer
description: 个人领取的待验收任务
required:
- unAcceptanceAsReceiver
unAcceptanceAsSponsor:
type: integer
description: 个人发起的待验收任务
required:
- unAcceptanceAsSponsor
unClaimedAsSponsor:
type: integer
description: 个人发起的待领取任务
required:
- unClaimedAsSponsor
unReleasedAsSponsor:
type: integer
description: 个人发起的待发布任务
required:
- unReleasedAsSponsor
underwayAsReceiver:
type: integer
description: 个人领取的进行中任务
required:
- underwayAsReceiver
underwayAsSponsor:
type: integer
description: 个人发起的进行中任务
required:
- underwayAsSponsor
description: 个人任务统计
referenceResourceItemRequestBody:
title: referenceResourceItemRequestBody
type: object
properties:
content:
type: string
description: 内容
required:
- content
issueScore:
type: number
description: 问题总分
format: double
referenceResourceId:
type: integer
description: 引用资源ID
required:
- referenceResourceId
serialNumber:
type: integer
description: 编号
required:
- serialNumber
solveScore:
type: array
items:
$ref: '#/definitions/solveScoreItemRequestBody'
description: 解决评分明细
title:
type: string
description: 标题
... ... @@ -1006,11 +1815,30 @@ definitions:
title: referenceResourceItemResponseBody
type: object
properties:
content:
type: string
description: 内容
required:
- content
issueScore:
type: number
description: 问题总分
format: double
referenceResourceId:
type: integer
description: 引用资源ID
required:
- referenceResourceId
serialNumber:
type: integer
description: 编号
required:
- serialNumber
solveScore:
type: array
items:
$ref: '#/definitions/solveScoreItemResponseBody'
description: 解决评分明细
title:
type: string
description: 标题
... ... @@ -1063,17 +1891,128 @@ definitions:
receiver:
$ref: '#/definitions/employeeInfoResponseBody'
description: 抢单任务信息
solveScoreItemRequestBody:
title: solveScoreItemRequestBody
type: object
properties:
contributor:
$ref: '#/definitions/employeeInfoRequestBody'
isReceiver:
type: boolean
description: 是否领取人
required:
- isReceiver
percentage:
type: integer
description: 解决占比
required:
- percentage
score:
type: number
description: 解决评分
required:
- score
description: 解决评分项
solveScoreItemResponseBody:
title: solveScoreItemResponseBody
type: object
properties:
contributor:
$ref: '#/definitions/employeeInfoResponseBody'
isReceiver:
type: boolean
description: 是否领取人
required:
- isReceiver
percentage:
type: integer
description: 解决占比
required:
- percentage
score:
type: number
description: 解决评分
required:
- score
description: 解决评分项
suMoneyTransactionRecordResponseBody:
title: suMoneyTransactionRecordResponseBody
type: object
properties:
createTime:
type: string
description: 创建时间
required:
- createTime
employee:
$ref: '#/definitions/employeeInfoResponseBody'
operator:
$ref: '#/definitions/employeeInfoResponseBody'
recordDescription:
type: string
description: 素币事务记录描述
required:
- recordDescription
recordType:
type: integer
description: 记录类型(1兑换,2任务奖励)
required:
- recordType
suMoney:
type: number
description: 事务素币值
required:
- suMoney
suMoneyBeforeTransaction:
type: number
description: 事务处理前素币值
required:
- suMoneyBeforeTransaction
suMoneyTransactionRecordId:
type: integer
description: 素币事务记录ID
required:
- suMoneyTransactionRecordId
description: 素币事务记录
systemTaskStatisticsResponseBody:
title: systemTaskStatisticsResponseBody
type: object
properties:
completed:
type: integer
description: 系统已完成任务
format: int64
released:
type: integer
description: 系统已发布任务
required:
- released
underway:
type: integer
description: 系统进行中任务
format: int64
description: 系统任务统计
taskPercentageItemRequestBody:
title: taskPercentageItemRequestBody
type: object
properties:
contributor:
$ref: '#/definitions/employeeInfoRequestBody'
isReceiver:
type: boolean
description: 是否领取人
required:
- isReceiver
percentage:
type: integer
description: 任务贡献占比
required:
- percentage
suMoney:
type: number
description: 分配到的奖励素币
required:
- suMoney
description: 任务贡献占比项
taskPercentageItemResponseBody:
title: taskPercentageItemResponseBody
... ... @@ -1081,11 +2020,21 @@ definitions:
properties:
contributor:
$ref: '#/definitions/employeeInfoResponseBody'
isReceiver:
type: boolean
description: 是否领取人
required:
- isReceiver
percentage:
type: integer
description: 任务贡献占比
required:
- percentage
suMoney:
type: number
description: 分配到的奖励素币
required:
- suMoney
description: 任务贡献占比项
taskResponseBody:
title: taskResponseBody
... ...
package query
import (
"fmt"
"github.com/astaxie/beego/validation"
)
type ListBidTimeMatchQuery struct {
}
func (listBidTimeMatchQuery *ListBidTimeMatchQuery) ValidateQuery() error {
valid := validation.Validation{}
b, err := valid.Valid(listBidTimeMatchQuery)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}
... ...
package query
import (
"fmt"
"github.com/astaxie/beego/validation"
)
type ListCustomerValueQuery struct {
}
func (listCustomerValueQuery *ListCustomerValueQuery) ValidateQuery() error {
valid := validation.Validation{}
b, err := valid.Valid(listCustomerValueQuery)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}
... ...
package query
import (
"fmt"
"github.com/astaxie/beego/validation"
)
type ListEmployeePermissionQuery struct {
}
func (listEmployeePermissionQuery *ListEmployeePermissionQuery) ValidateQuery() error {
valid := validation.Validation{}
b, err := valid.Valid(listEmployeePermissionQuery)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}
... ...
package query
import (
"fmt"
"github.com/astaxie/beego/validation"
)
type ListReferenceResourceTypeQuery struct {
}
func (listReferenceResourceTypeQuery *ListReferenceResourceTypeQuery) ValidateQuery() error {
valid := validation.Validation{}
b, err := valid.Valid(listReferenceResourceTypeQuery)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}
... ...
package query
import (
"fmt"
"github.com/astaxie/beego/validation"
)
type ListTaskNatureQuery struct {
}
func (listTaskNatureQuery *ListTaskNatureQuery) ValidateQuery() error {
valid := validation.Validation{}
b, err := valid.Valid(listTaskNatureQuery)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}
... ...
package query
import (
"fmt"
"github.com/astaxie/beego/validation"
)
type ListTaskStatusQuery struct {
}
func (listTaskStatusQuery *ListTaskStatusQuery) ValidateQuery() error {
valid := validation.Validation{}
b, err := valid.Valid(listTaskStatusQuery)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}
... ...
package query
import (
"fmt"
"github.com/astaxie/beego/validation"
)
type ListTaskTypeQuery struct {
}
func (listTaskTypeQuery *ListTaskTypeQuery) ValidateQuery() error {
valid := validation.Validation{}
b, err := valid.Valid(listTaskTypeQuery)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}
... ...
package service
import (
"github.com/linmadan/egglib-go/core/application"
"gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/application/config/query"
)
// 配置服务
type ConfigService struct {
}
// 返回任务状态列表
func (configService *ConfigService) ListTaskStatus(listTaskStatusQuery *query.ListTaskStatusQuery) (interface{}, error) {
if err := listTaskStatusQuery.ValidateQuery(); err != nil {
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
taskStatusMap := map[int]string{
1: "待发布",
2: "待领取",
3: "进行中",
4: "待验收",
5: "已完成",
}
var list []map[string]interface{}
for key, value := range taskStatusMap {
list = append(list, map[string]interface{}{
"id": key,
"name": value,
})
}
return map[string]interface{}{
"taskStatuses": list,
}, nil
}
// 返回任务类型列表
func (configService *ConfigService) ListTaskType(listTaskTypeQuery *query.ListTaskTypeQuery) (interface{}, error) {
if err := listTaskTypeQuery.ValidateQuery(); err != nil {
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
taskTypeMap := map[int]string{
1: "抢单任务",
2: "竞标任务",
}
var list []map[string]interface{}
for key, value := range taskTypeMap {
list = append(list, map[string]interface{}{
"id": key,
"name": value,
})
}
return map[string]interface{}{
"taskTypes": list,
}, nil
}
// 返回任务性质列表
func (configService *ConfigService) ListTaskNature(listTaskNatureQuery *query.ListTaskNatureQuery) (interface{}, error) {
if err := listTaskNatureQuery.ValidateQuery(); err != nil {
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
taskNatureMap := map[int]string{
1: "点",
2: "线",
3: "面",
4: "链",
5: "网",
}
var list []map[string]interface{}
for key, value := range taskNatureMap {
list = append(list, map[string]interface{}{
"id": key,
"name": value,
})
}
return map[string]interface{}{
"taskNatures": list,
}, nil
}
// 返回客户价值列表
func (configService *ConfigService) ListCustomerValue(listCustomerValueQuery *query.ListCustomerValueQuery) (interface{}, error) {
if err := listCustomerValueQuery.ValidateQuery(); err != nil {
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
customerValueMap := map[int]string{
1: "口味",
2: "口感",
3: "色泽",
4: "卖相",
5: "包装",
6: "储存",
7: "运输",
8: "价格",
9: "应用",
10: "便利",
11: "交期",
12: "数量",
13: "账期",
14: "品质",
15: "新鲜度",
16: "推广",
17: "规格",
18: "人情关系",
19: "商务服务",
20: "售后服务",
21: "新品",
22: "品牌",
23: "合同",
}
var list []map[string]interface{}
for key, value := range customerValueMap {
list = append(list, map[string]interface{}{
"id": key,
"name": value,
})
}
return map[string]interface{}{
"customerValues": list,
}, nil
}
// 返回任务引用资源类型字典列表
func (configService *ConfigService) ListReferenceResourceType(listReferenceResourceTypeQuery *query.ListReferenceResourceTypeQuery) (interface{}, error) {
if err := listReferenceResourceTypeQuery.ValidateQuery(); err != nil {
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
referenceResourceTypeMap := map[int]string{
1: "问题",
//2: "机会",
}
var list []map[string]interface{}
for key, value := range referenceResourceTypeMap {
list = append(list, map[string]interface{}{
"id": key,
"name": value,
})
}
return map[string]interface{}{
"referenceResourceTypes": list,
}, nil
}
// 返回竞标时间字典列表(1全部,2已截止,3未截止)
func (configService *ConfigService) ListBidTimeMatch(listBidTimeMatchQuery *query.ListBidTimeMatchQuery) (interface{}, error) {
if err := listBidTimeMatchQuery.ValidateQuery(); err != nil {
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
bidTimeMatchMap := map[int]string{
1: "全部",
2: "已截止",
3: "未截止",
}
var list []map[string]interface{}
for key, value := range bidTimeMatchMap {
list = append(list, map[string]interface{}{
"id": key,
"name": value,
})
}
return map[string]interface{}{
"bidTimeMatchs": list,
}, nil
}
// 返回员工权限字典列表(1任务管理,2素币管理,3成员管理)
func (configService *ConfigService) ListEmployeePermission(listEmployeePermissionQuery *query.ListEmployeePermissionQuery) (interface{}, error) {
if err := listEmployeePermissionQuery.ValidateQuery(); err != nil {
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
employeePermissionMap := map[int]string{
1: "任务管理",
2: "素币管理",
3: "成员管理",
}
var list []map[string]interface{}
for key, value := range employeePermissionMap {
list = append(list, map[string]interface{}{
"id": key,
"name": value,
})
}
return map[string]interface{}{
"employeePermissions": list,
}, nil
}
func NewConfigService(options map[string]interface{}) *ConfigService {
newConfigService := &ConfigService{}
return newConfigService
}
... ...
... ... @@ -2,15 +2,19 @@ package command
import (
"fmt"
"github.com/astaxie/beego/validation"
)
type CreateEmployeeCommand struct {
// 统一用户UID
Uid int64 `json:"uid" valid:"Required"`
// 员工姓名
EmployeeName string `json:"employeeName" valid:"Required"`
EmployeeName string `json:"employeeName,omitempty"`
// 员工账号
EmployeeAccount string `json:"employeeAccount" valid:"Required"`
EmployeeAccount string `json:"employeeAccount,omitempty"`
// 员工头像URL
EmployeeAvatarUrl string `json:"employeeAvatarUrl,omitempty"`
}
func (createEmployeeCommand *CreateEmployeeCommand) ValidateCommand() error {
... ...
... ... @@ -2,6 +2,7 @@ package command
import (
"fmt"
"github.com/astaxie/beego/validation"
)
... ...
... ... @@ -2,6 +2,7 @@ package command
import (
"fmt"
"github.com/astaxie/beego/validation"
)
... ... @@ -12,6 +13,10 @@ type UpdateEmployeeCommand struct {
EmployeeName string `json:"employeeName,omitempty"`
// 员工账号
EmployeeAccount string `json:"employeeAccount,omitempty"`
// 员工头像URL
EmployeeAvatarUrl string `json:"employeeAvatarUrl,omitempty"`
// 员工权限集合
Permissions []int `json:"permissions,omitempty"`
}
func (updateEmployeeCommand *UpdateEmployeeCommand) ValidateCommand() error {
... ...
... ... @@ -2,6 +2,7 @@ package query
import (
"fmt"
"github.com/astaxie/beego/validation"
)
... ...
... ... @@ -2,10 +2,15 @@ package query
import (
"fmt"
"github.com/astaxie/beego/validation"
)
type ListEmployeeQuery struct {
// 公司ID
CompanyId int64 `json:"companyId" valid:"Required"`
// 员工姓名匹配
EmployeeNameMatch string `json:"employeeNameMatch,omitempty"`
// 查询偏离量
Offset int `json:"offset,omitempty"`
// 查询限制
... ...
package subscriber
import (
"fmt"
"github.com/linmadan/egglib-go/core/domain"
"gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/application/factory"
"gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/domain/event"
)
type AbilityServiceSubscriber struct {
}
func (subscriber *AbilityServiceSubscriber) HandleEvent(domainEvent domain.DomainEvent) error {
abilityServiceGateway, err := factory.CreateAbilityServiceGateway(nil)
if err != nil {
return err
}
switch domainEvent.EventType() {
case event.TASK_RELEASED_EVENT:
taskReleasedEvent := domainEvent.(*event.TaskReleased)
var serials []int64
for _, referenceResourceItem := range taskReleasedEvent.ReferenceResource.ReferenceResourceItems {
serials = append(serials, referenceResourceItem.SerialNumber)
}
data, err := abilityServiceGateway.CommitQuestionQuotes(taskReleasedEvent.Sponsor.Uid, taskReleasedEvent.TaskId, serials)
if err != nil {
fmt.Println(err.Error())
return err
}
fmt.Println(data)
break
case event.TASK_CLOSED_EVENT:
taskClosedEvent := domainEvent.(*event.TaskClosed)
var referenceResourceIds []int64
for _, referenceResourceItem := range taskClosedEvent.ReferenceResource.ReferenceResourceItems {
referenceResourceIds = append(referenceResourceIds, referenceResourceItem.ReferenceResourceId)
}
data, err := abilityServiceGateway.CloseTaskCallback(taskClosedEvent.TaskId, referenceResourceIds)
if err != nil {
fmt.Println(err.Error())
return err
}
fmt.Println(data)
break
case event.TASK_ROBED_EVENT:
taskRobedEvent := domainEvent.(*event.TaskRobed)
var referenceResourceIds []int64
for _, referenceResourceItem := range taskRobedEvent.ReferenceResource.ReferenceResourceItems {
referenceResourceIds = append(referenceResourceIds, referenceResourceItem.ReferenceResourceId)
}
data, err := abilityServiceGateway.ReceiverTaskCallback(taskRobedEvent.RobInfo.Receiver.Uid, taskRobedEvent.TaskId, referenceResourceIds, taskRobedEvent.RobInfo.Receiver.Uid, taskRobedEvent.RobInfo.ReceiveTime)
if err != nil {
fmt.Println(err.Error())
return err
}
fmt.Println(data)
break
case event.TASK_BIDDED_EVENT:
taskBiddedEvent := domainEvent.(*event.TaskBidded)
var referenceResourceIds []int64
for _, referenceResourceItem := range taskBiddedEvent.ReferenceResource.ReferenceResourceItems {
referenceResourceIds = append(referenceResourceIds, referenceResourceItem.ReferenceResourceId)
}
data, err := abilityServiceGateway.ReceiverTaskCallback(taskBiddedEvent.BidInfo.SuccessfulBidder.Uid, taskBiddedEvent.TaskId, referenceResourceIds, taskBiddedEvent.Operator.Uid, taskBiddedEvent.BidInfo.WinBidTime)
if err != nil {
fmt.Println(err.Error())
return err
}
fmt.Println(data)
break
case event.TASK_ACCEPTANCED_EVENT:
taskAcceptancedEvent := domainEvent.(*event.TaskAcceptanced)
if taskAcceptancedEvent.ReferenceResource != nil {
var solveUid int64
var scoreSolve float64
var partners []map[string]interface{}
for _, referenceResourceItem := range taskAcceptancedEvent.ReferenceResource.ReferenceResourceItems {
for _, solveScore := range referenceResourceItem.SolveScore {
if solveScore.IsReceiver {
solveUid = solveScore.Contributor.Uid
scoreSolve = solveScore.Score
} else {
partners = append(partners, map[string]interface{}{
"uid": solveScore.Contributor.Uid,
"scoreSolution": solveScore.Score,
})
}
}
data, err := abilityServiceGateway.CommitQuestionSolution(referenceResourceItem.ReferenceResourceId, taskAcceptancedEvent.Sponsor.Uid, solveUid, taskAcceptancedEvent.SolveReport, scoreSolve, taskAcceptancedEvent.SolvePictureUrls, partners)
if err != nil {
return err
}
fmt.Println(data)
}
}
break
}
return nil
}
func (subscriber *AbilityServiceSubscriber) SubscribedToEventTypes() []string {
return [] string{
event.TASK_RELEASED_EVENT,
event.TASK_ACCEPTANCED_EVENT,
event.TASK_CLOSED_EVENT,
event.TASK_ROBED_EVENT,
event.TASK_BIDDED_EVENT,
}
}
... ...
... ... @@ -12,3 +12,11 @@ func CreateTaskDao(options map[string]interface{}) (*dao.TaskDao, error) {
}
return dao.NewTaskDao(transactionContext)
}
func CreateEmployeeDao(options map[string]interface{}) (*dao.EmployeeDao, error) {
var transactionContext *pg.TransactionContext
if value, ok := options["transactionContext"]; ok {
transactionContext = value.(*pg.TransactionContext)
}
return dao.NewEmployeeDao(transactionContext)
}
... ...
... ... @@ -53,3 +53,19 @@ func CreateApplyCompleteTaskService(options map[string]interface{}) (service.App
}
return domainService.NewApplyCompleteTaskService(transactionContext)
}
func CreateAcceptanceTaskService(options map[string]interface{}) (service.AcceptanceTaskService, error) {
var transactionContext *pgTransaction.TransactionContext
if value, ok := options["transactionContext"]; ok {
transactionContext = value.(*pgTransaction.TransactionContext)
}
return domainService.NewAcceptanceTaskService(transactionContext)
}
func CreateExchangeSuMoneyService(options map[string]interface{}) (service.ExchangeSuMoneyService, error) {
var transactionContext *pgTransaction.TransactionContext
if value, ok := options["transactionContext"]; ok {
transactionContext = value.(*pgTransaction.TransactionContext)
}
return domainService.NewExchangeSuMoneyService(transactionContext)
}
... ...
... ... @@ -29,3 +29,11 @@ func CreateOffTaskRecordRepository(options map[string]interface{}) (domain.OffTa
}
return repository.NewOffTaskRecordRepository(transactionContext)
}
func CreateSuMoneyTransactionRecordRepository(options map[string]interface{}) (domain.SuMoneyTransactionRecordRepository, error) {
var transactionContext *pg.TransactionContext
if value, ok := options["transactionContext"]; ok {
transactionContext = value.(*pg.TransactionContext)
}
return repository.NewSuMoneyTransactionRecordRepository(transactionContext)
}
... ...
package factory
import serviceGateway "gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/infrastructure/service_gateway"
func CreateAbilityServiceGateway(options map[string]interface{}) (serviceGateway.AbilityServiceGateway, error) {
return serviceGateway.NewHttplibAbilityServiceGateway(), nil
}
... ...
package command
import (
"fmt"
"github.com/astaxie/beego/validation"
)
type PersonSuMoneyStatisticsCommand struct {
// 统一用户UID
Uid int64 `json:"uid" valid:"Required"`
}
func (personSuMoneyStatisticsCommand *PersonSuMoneyStatisticsCommand) ValidateCommand() error {
valid := validation.Validation{}
b, err := valid.Valid(personSuMoneyStatisticsCommand)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}
... ...
package command
import (
"fmt"
"github.com/astaxie/beego/validation"
)
type PersonTaskStatisticsCommand struct {
// 统一用户UID
Uid int64 `json:"uid" valid:"Required"`
}
func (personTaskStatisticsCommand *PersonTaskStatisticsCommand) ValidateCommand() error {
valid := validation.Validation{}
b, err := valid.Valid(personTaskStatisticsCommand)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}
... ...
package command
import (
"fmt"
"github.com/astaxie/beego/validation"
)
type SystemTaskStatisticsCommand struct {
// 公司ID
CompanyId int64 `json:"companyId" valid:"Required"`
}
func (systemTaskStatisticsCommand *SystemTaskStatisticsCommand) ValidateCommand() error {
valid := validation.Validation{}
b, err := valid.Valid(systemTaskStatisticsCommand)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}
... ...
package service
import (
"github.com/linmadan/egglib-go/core/application"
"gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/application/factory"
"gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/application/statistics/command"
"gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/domain"
"gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/infrastructure/dao"
)
// 数据统计服务
type StatisticsService struct {
}
// 获取系统任务统计
func (statisticsService *StatisticsService) SystemTaskStatistics(systemTaskStatisticsCommand *command.SystemTaskStatisticsCommand) (interface{}, error) {
if err := systemTaskStatisticsCommand.ValidateCommand(); err != nil {
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
transactionContext, err := factory.CreateTransactionContext(nil)
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
if err := transactionContext.StartTransaction(); err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
defer func() {
transactionContext.RollbackTransaction()
}()
var taskDao *dao.TaskDao
if value, err := factory.CreateTaskDao(map[string]interface{}{
"transactionContext": transactionContext,
}); err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
} else {
taskDao = value
}
if systemTaskStatistics, err := taskDao.CalculateSystemTask(systemTaskStatisticsCommand.CompanyId); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
if err := transactionContext.CommitTransaction(); err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return systemTaskStatistics, nil
}
}
// 获取个人任务统计
func (statisticsService *StatisticsService) PersonTaskStatistics(personTaskStatisticsCommand *command.PersonTaskStatisticsCommand) (interface{}, error) {
if err := personTaskStatisticsCommand.ValidateCommand(); err != nil {
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
transactionContext, err := factory.CreateTransactionContext(nil)
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
if err := transactionContext.StartTransaction(); err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
defer func() {
transactionContext.RollbackTransaction()
}()
var taskDao *dao.TaskDao
if value, err := factory.CreateTaskDao(map[string]interface{}{
"transactionContext": transactionContext,
}); err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
} else {
taskDao = value
}
var employeeRepository domain.EmployeeRepository
if value, err := factory.CreateEmployeeRepository(map[string]interface{}{
"transactionContext": transactionContext,
}); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
employeeRepository = value
}
employee, err := employeeRepository.FindOne(map[string]interface{}{
"uid": personTaskStatisticsCommand.Uid,
})
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
if employee == nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "无效的企业员工")
}
if personTaskStatistics, err := taskDao.CalculatePersonTask(personTaskStatisticsCommand.Uid); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
if err := transactionContext.CommitTransaction(); err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return personTaskStatistics, nil
}
}
// 获取个人素币统计
func (statisticsService *StatisticsService) PersonSuMoneyStatistics(personSuMoneyStatisticsCommand *command.PersonSuMoneyStatisticsCommand) (interface{}, error) {
if err := personSuMoneyStatisticsCommand.ValidateCommand(); err != nil {
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
transactionContext, err := factory.CreateTransactionContext(nil)
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
if err := transactionContext.StartTransaction(); err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
defer func() {
transactionContext.RollbackTransaction()
}()
var employeeDao *dao.EmployeeDao
if value, err := factory.CreateEmployeeDao(map[string]interface{}{
"transactionContext": transactionContext,
}); err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
} else {
employeeDao = value
}
var employeeRepository domain.EmployeeRepository
if value, err := factory.CreateEmployeeRepository(map[string]interface{}{
"transactionContext": transactionContext,
}); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
employeeRepository = value
}
employee, err := employeeRepository.FindOne(map[string]interface{}{
"uid": personSuMoneyStatisticsCommand.Uid,
})
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
if employee == nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "无效的企业员工")
}
if personSuMoneyStatistics, err := employeeDao.CalculatePersonSuMoney(personSuMoneyStatisticsCommand.Uid); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
if err := transactionContext.CommitTransaction(); err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
personSuMoneyStatistics["currentSuMoney"] = employee.SuMoney
return personSuMoneyStatistics, nil
}
}
func NewStatisticsService(options map[string]interface{}) *StatisticsService {
newStatisticsService := &StatisticsService{}
return newStatisticsService
}
... ...
package command
import (
"fmt"
"github.com/astaxie/beego/validation"
)
type ExchangeSuMoneyCommand struct {
// 兑换人UID
Uid int64 `json:"uid" valid:"Required"`
// 素币值
SuMoney float64 `json:"suMoney" valid:"Required"`
// 操作人UID
Operator int64 `json:"operator,omitempty"`
// 兑换描述
ExchangeDescription string `json:"exchangeDescription" valid:"Required"`
}
func (exchangeSuMoneyCommand *ExchangeSuMoneyCommand) ValidateCommand() error {
valid := validation.Validation{}
b, err := valid.Valid(exchangeSuMoneyCommand)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}
... ...
package command
import (
"fmt"
"time"
"github.com/astaxie/beego/validation"
)
type SearchSuMoneyTransactionRecordCommand struct {
// 统一用户UID
Uid int64 `json:"uid" valid:"Required"`
// 记录类型(1兑换,2任务奖励)
RecordType int `json:"recordType,omitempty"`
// 操作人UID
// 事务时间区间-开始时间
TransactionStartTime time.Time `json:"transactionStartTime,omitempty"`
// 事务时间区间-截止时间
TransactionEndTime time.Time `json:"transactionEndTime,omitempty"`
Operator int64 `json:"operator,omitempty"`
// 查询偏离量
Offset int `json:"offset,omitempty"`
// 查询限制
Limit int `json:"limit,omitempty"`
}
func (searchSuMoneyTransactionRecordCommand *SearchSuMoneyTransactionRecordCommand) ValidateCommand() error {
valid := validation.Validation{}
b, err := valid.Valid(searchSuMoneyTransactionRecordCommand)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}
... ...
package command
import (
"fmt"
"time"
"github.com/astaxie/beego/validation"
)
type SuMoneyTransactionRecordStatisticsCommand struct {
// 统一用户UID
Uid int64 `json:"uid" valid:"Required"`
// 事务时间区间-开始时间
TransactionStartTime time.Time `json:"transactionStartTime,omitempty"`
// 事务时间区间-截止时间
TransactionEndTime time.Time `json:"transactionEndTime,omitempty"`
}
func (suMoneyTransactionRecordStatisticsCommand *SuMoneyTransactionRecordStatisticsCommand) ValidateCommand() error {
valid := validation.Validation{}
b, err := valid.Valid(suMoneyTransactionRecordStatisticsCommand)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}
... ...
package query
import (
"fmt"
"github.com/astaxie/beego/validation"
)
type GetSuMoneyTransactionRecordQuery struct {
// 素币事务记录ID
SuMoneyTransactionRecordId int64 `json:"suMoneyTransactionRecordId" valid:"Required"`
}
func (getSuMoneyTransactionRecordQuery *GetSuMoneyTransactionRecordQuery) ValidateQuery() error {
valid := validation.Validation{}
b, err := valid.Valid(getSuMoneyTransactionRecordQuery)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}
... ...