正在显示
5 个修改的文件
包含
143 行增加
和
13 行删除
| @@ -570,7 +570,7 @@ | @@ -570,7 +570,7 @@ | ||
| 570 | { | 570 | { |
| 571 | "name": "notificationType", | 571 | "name": "notificationType", |
| 572 | "in": "query", | 572 | "in": "query", |
| 573 | - "description": "通知类型", | 573 | + "description": "通知类型(1.系统通知2.互动通知)", |
| 574 | "required": false, | 574 | "required": false, |
| 575 | "type": "integer" | 575 | "type": "integer" |
| 576 | }, | 576 | }, |
| @@ -638,8 +638,8 @@ | @@ -638,8 +638,8 @@ | ||
| 638 | "tags": [ | 638 | "tags": [ |
| 639 | "notification" | 639 | "notification" |
| 640 | ], | 640 | ], |
| 641 | - "summary": "读取全部为读取的发送出的通知", | ||
| 642 | - "description": "读取全部为读取的发送出的通知", | 641 | + "summary": "读取全部未读取的发送出的通知", |
| 642 | + "description": "读取全部未读取的发送出的通知", | ||
| 643 | "operationId": "notification#readAllUnReadSentNotification", | 643 | "operationId": "notification#readAllUnReadSentNotification", |
| 644 | "parameters": [ | 644 | "parameters": [ |
| 645 | { | 645 | { |
| @@ -967,6 +967,37 @@ | @@ -967,6 +967,37 @@ | ||
| 967 | ] | 967 | ] |
| 968 | } | 968 | } |
| 969 | }, | 969 | }, |
| 970 | + "/statistics/person-notification": { | ||
| 971 | + "post": { | ||
| 972 | + "tags": [ | ||
| 973 | + "statistics" | ||
| 974 | + ], | ||
| 975 | + "summary": "获取个人消息通知统计", | ||
| 976 | + "description": "获取个人消息通知统计", | ||
| 977 | + "operationId": "statistics#personNotificationStatistics", | ||
| 978 | + "parameters": [ | ||
| 979 | + { | ||
| 980 | + "name": "PersonNotificationStatisticsRequestBody", | ||
| 981 | + "in": "body", | ||
| 982 | + "required": true, | ||
| 983 | + "schema": { | ||
| 984 | + "$ref": "#/definitions/StatisticsPersonNotificationStatisticsRequestBody" | ||
| 985 | + } | ||
| 986 | + } | ||
| 987 | + ], | ||
| 988 | + "responses": { | ||
| 989 | + "200": { | ||
| 990 | + "description": "OK response.", | ||
| 991 | + "schema": { | ||
| 992 | + "$ref": "#/definitions/StatisticsPersonNotificationStatisticsResponseBody" | ||
| 993 | + } | ||
| 994 | + } | ||
| 995 | + }, | ||
| 996 | + "schemes": [ | ||
| 997 | + "http" | ||
| 998 | + ] | ||
| 999 | + } | ||
| 1000 | + }, | ||
| 970 | "/statistics/person-su-money": { | 1001 | "/statistics/person-su-money": { |
| 971 | "post": { | 1002 | "post": { |
| 972 | "tags": [ | 1003 | "tags": [ |
| @@ -2615,6 +2646,35 @@ | @@ -2615,6 +2646,35 @@ | ||
| 2615 | } | 2646 | } |
| 2616 | } | 2647 | } |
| 2617 | }, | 2648 | }, |
| 2649 | + "StatisticsPersonNotificationStatisticsRequestBody": { | ||
| 2650 | + "title": "StatisticsPersonNotificationStatisticsRequestBody", | ||
| 2651 | + "type": "object", | ||
| 2652 | + "properties": { | ||
| 2653 | + "uid": { | ||
| 2654 | + "type": "integer", | ||
| 2655 | + "description": "统一用户UID", | ||
| 2656 | + "required": [ | ||
| 2657 | + "uid" | ||
| 2658 | + ] | ||
| 2659 | + } | ||
| 2660 | + } | ||
| 2661 | + }, | ||
| 2662 | + "StatisticsPersonNotificationStatisticsResponseBody": { | ||
| 2663 | + "title": "Mediatype identifier: StatisticsPersonNotificationStatisticsResponseBody", | ||
| 2664 | + "type": "object", | ||
| 2665 | + "properties": { | ||
| 2666 | + "unReadInteractionNotification": { | ||
| 2667 | + "type": "integer", | ||
| 2668 | + "description": "未读互动消息条数", | ||
| 2669 | + "format": "int64" | ||
| 2670 | + }, | ||
| 2671 | + "unReadSystemNotification": { | ||
| 2672 | + "type": "integer", | ||
| 2673 | + "description": "未读系统消息条数", | ||
| 2674 | + "format": "int64" | ||
| 2675 | + } | ||
| 2676 | + } | ||
| 2677 | + }, | ||
| 2618 | "StatisticsPersonSuMoneyStatisticsRequestBody": { | 2678 | "StatisticsPersonSuMoneyStatisticsRequestBody": { |
| 2619 | "title": "StatisticsPersonSuMoneyStatisticsRequestBody", | 2679 | "title": "StatisticsPersonSuMoneyStatisticsRequestBody", |
| 2620 | "type": "object", | 2680 | "type": "object", |
| @@ -3634,6 +3694,14 @@ | @@ -3634,6 +3694,14 @@ | ||
| 3634 | "type": "integer", | 3694 | "type": "integer", |
| 3635 | "description": "任务类型", | 3695 | "description": "任务类型", |
| 3636 | "format": "int64" | 3696 | "format": "int64" |
| 3697 | + }, | ||
| 3698 | + "taskTypes": { | ||
| 3699 | + "type": "array", | ||
| 3700 | + "items": { | ||
| 3701 | + "type": "integer", | ||
| 3702 | + "format": "int64" | ||
| 3703 | + }, | ||
| 3704 | + "description": "任务类型列表" | ||
| 3637 | } | 3705 | } |
| 3638 | } | 3706 | } |
| 3639 | }, | 3707 | }, |
| @@ -4007,12 +4075,19 @@ | @@ -4007,12 +4075,19 @@ | ||
| 4007 | "type": "object", | 4075 | "type": "object", |
| 4008 | "properties": { | 4076 | "properties": { |
| 4009 | "externalResource": { | 4077 | "externalResource": { |
| 4010 | - "type": "string", | 4078 | + "type": "integer", |
| 4011 | "description": "外部资源引用", | 4079 | "description": "外部资源引用", |
| 4012 | "required": [ | 4080 | "required": [ |
| 4013 | "externalResource" | 4081 | "externalResource" |
| 4014 | ] | 4082 | ] |
| 4015 | }, | 4083 | }, |
| 4084 | + "externalResourceType": { | ||
| 4085 | + "type": "integer", | ||
| 4086 | + "description": "外部资源引用类型(1任务2驳回任务记录)", | ||
| 4087 | + "required": [ | ||
| 4088 | + "externalResourceType" | ||
| 4089 | + ] | ||
| 4090 | + }, | ||
| 4016 | "notificationContent": { | 4091 | "notificationContent": { |
| 4017 | "type": "string", | 4092 | "type": "string", |
| 4018 | "description": "通知内容", | 4093 | "description": "通知内容", |
| @@ -4043,7 +4118,7 @@ | @@ -4043,7 +4118,7 @@ | ||
| 4043 | }, | 4118 | }, |
| 4044 | "notificationType": { | 4119 | "notificationType": { |
| 4045 | "type": "integer", | 4120 | "type": "integer", |
| 4046 | - "description": "通知类型", | 4121 | + "description": "通知类型(1.系统通知2.互动通知)", |
| 4047 | "required": [ | 4122 | "required": [ |
| 4048 | "notificationType" | 4123 | "notificationType" |
| 4049 | ] | 4124 | ] |
| @@ -385,7 +385,7 @@ paths: | @@ -385,7 +385,7 @@ paths: | ||
| 385 | type: integer | 385 | type: integer |
| 386 | - name: notificationType | 386 | - name: notificationType |
| 387 | in: query | 387 | in: query |
| 388 | - description: 通知类型 | 388 | + description: 通知类型(1.系统通知2.互动通知) |
| 389 | required: false | 389 | required: false |
| 390 | type: integer | 390 | type: integer |
| 391 | - name: offset | 391 | - name: offset |
| @@ -429,8 +429,8 @@ paths: | @@ -429,8 +429,8 @@ paths: | ||
| 429 | post: | 429 | post: |
| 430 | tags: | 430 | tags: |
| 431 | - notification | 431 | - notification |
| 432 | - summary: 读取全部为读取的发送出的通知 | ||
| 433 | - description: 读取全部为读取的发送出的通知 | 432 | + summary: 读取全部未读取的发送出的通知 |
| 433 | + description: 读取全部未读取的发送出的通知 | ||
| 434 | operationId: notification#readAllUnReadSentNotification | 434 | operationId: notification#readAllUnReadSentNotification |
| 435 | parameters: | 435 | parameters: |
| 436 | - name: ReadAllUnReadSentNotificationRequestBody | 436 | - name: ReadAllUnReadSentNotificationRequestBody |
| @@ -647,6 +647,26 @@ paths: | @@ -647,6 +647,26 @@ paths: | ||
| 647 | $ref: '#/definitions/RejectTaskRecordSearchRejectTaskRecordResponseBody' | 647 | $ref: '#/definitions/RejectTaskRecordSearchRejectTaskRecordResponseBody' |
| 648 | schemes: | 648 | schemes: |
| 649 | - http | 649 | - http |
| 650 | + /statistics/person-notification: | ||
| 651 | + post: | ||
| 652 | + tags: | ||
| 653 | + - statistics | ||
| 654 | + summary: 获取个人消息通知统计 | ||
| 655 | + description: 获取个人消息通知统计 | ||
| 656 | + operationId: statistics#personNotificationStatistics | ||
| 657 | + parameters: | ||
| 658 | + - name: PersonNotificationStatisticsRequestBody | ||
| 659 | + in: body | ||
| 660 | + required: true | ||
| 661 | + schema: | ||
| 662 | + $ref: '#/definitions/StatisticsPersonNotificationStatisticsRequestBody' | ||
| 663 | + responses: | ||
| 664 | + "200": | ||
| 665 | + description: OK response. | ||
| 666 | + schema: | ||
| 667 | + $ref: '#/definitions/StatisticsPersonNotificationStatisticsResponseBody' | ||
| 668 | + schemes: | ||
| 669 | + - http | ||
| 650 | /statistics/person-su-money: | 670 | /statistics/person-su-money: |
| 651 | post: | 671 | post: |
| 652 | tags: | 672 | tags: |
| @@ -1766,6 +1786,27 @@ definitions: | @@ -1766,6 +1786,27 @@ definitions: | ||
| 1766 | type: array | 1786 | type: array |
| 1767 | items: | 1787 | items: |
| 1768 | $ref: '#/definitions/rejectTaskRecordResponseBody' | 1788 | $ref: '#/definitions/rejectTaskRecordResponseBody' |
| 1789 | + StatisticsPersonNotificationStatisticsRequestBody: | ||
| 1790 | + title: StatisticsPersonNotificationStatisticsRequestBody | ||
| 1791 | + type: object | ||
| 1792 | + properties: | ||
| 1793 | + uid: | ||
| 1794 | + type: integer | ||
| 1795 | + description: 统一用户UID | ||
| 1796 | + required: | ||
| 1797 | + - uid | ||
| 1798 | + StatisticsPersonNotificationStatisticsResponseBody: | ||
| 1799 | + title: 'Mediatype identifier: StatisticsPersonNotificationStatisticsResponseBody' | ||
| 1800 | + type: object | ||
| 1801 | + properties: | ||
| 1802 | + unReadInteractionNotification: | ||
| 1803 | + type: integer | ||
| 1804 | + description: 未读互动消息条数 | ||
| 1805 | + format: int64 | ||
| 1806 | + unReadSystemNotification: | ||
| 1807 | + type: integer | ||
| 1808 | + description: 未读系统消息条数 | ||
| 1809 | + format: int64 | ||
| 1769 | StatisticsPersonSuMoneyStatisticsRequestBody: | 1810 | StatisticsPersonSuMoneyStatisticsRequestBody: |
| 1770 | title: StatisticsPersonSuMoneyStatisticsRequestBody | 1811 | title: StatisticsPersonSuMoneyStatisticsRequestBody |
| 1771 | type: object | 1812 | type: object |
| @@ -2498,6 +2539,12 @@ definitions: | @@ -2498,6 +2539,12 @@ definitions: | ||
| 2498 | type: integer | 2539 | type: integer |
| 2499 | description: 任务类型 | 2540 | description: 任务类型 |
| 2500 | format: int64 | 2541 | format: int64 |
| 2542 | + taskTypes: | ||
| 2543 | + type: array | ||
| 2544 | + items: | ||
| 2545 | + type: integer | ||
| 2546 | + format: int64 | ||
| 2547 | + description: 任务类型列表 | ||
| 2501 | TaskSearchTaskResponseBody: | 2548 | TaskSearchTaskResponseBody: |
| 2502 | title: 'Mediatype identifier: TaskSearchTaskResponseBody' | 2549 | title: 'Mediatype identifier: TaskSearchTaskResponseBody' |
| 2503 | type: object | 2550 | type: object |
| @@ -2767,10 +2814,15 @@ definitions: | @@ -2767,10 +2814,15 @@ definitions: | ||
| 2767 | type: object | 2814 | type: object |
| 2768 | properties: | 2815 | properties: |
| 2769 | externalResource: | 2816 | externalResource: |
| 2770 | - type: string | 2817 | + type: integer |
| 2771 | description: 外部资源引用 | 2818 | description: 外部资源引用 |
| 2772 | required: | 2819 | required: |
| 2773 | - externalResource | 2820 | - externalResource |
| 2821 | + externalResourceType: | ||
| 2822 | + type: integer | ||
| 2823 | + description: 外部资源引用类型(1任务2驳回任务记录) | ||
| 2824 | + required: | ||
| 2825 | + - externalResourceType | ||
| 2774 | notificationContent: | 2826 | notificationContent: |
| 2775 | type: string | 2827 | type: string |
| 2776 | description: 通知内容 | 2828 | description: 通知内容 |
| @@ -2793,7 +2845,7 @@ definitions: | @@ -2793,7 +2845,7 @@ definitions: | ||
| 2793 | - notificationTitle | 2845 | - notificationTitle |
| 2794 | notificationType: | 2846 | notificationType: |
| 2795 | type: integer | 2847 | type: integer |
| 2796 | - description: 通知类型 | 2848 | + description: 通知类型(1.系统通知2.互动通知) |
| 2797 | required: | 2849 | required: |
| 2798 | - notificationType | 2850 | - notificationType |
| 2799 | description: 通知 | 2851 | description: 通知 |
| @@ -18,6 +18,8 @@ func (controller *NotificationController) ReadSentNotification() { | @@ -18,6 +18,8 @@ func (controller *NotificationController) ReadSentNotification() { | ||
| 18 | notificationService := service.NewNotificationService(nil) | 18 | notificationService := service.NewNotificationService(nil) |
| 19 | readSentNotificationCommand := &command.ReadSentNotificationCommand{} | 19 | readSentNotificationCommand := &command.ReadSentNotificationCommand{} |
| 20 | json.Unmarshal(controller.Ctx.Input.GetData("requestBody").([]byte), readSentNotificationCommand) | 20 | json.Unmarshal(controller.Ctx.Input.GetData("requestBody").([]byte), readSentNotificationCommand) |
| 21 | + sentNotificationId, _ := controller.GetInt64(":sentNotificationId") | ||
| 22 | + readSentNotificationCommand.SentNotificationId = sentNotificationId | ||
| 21 | data, err := notificationService.ReadSentNotification(readSentNotificationCommand) | 23 | data, err := notificationService.ReadSentNotification(readSentNotificationCommand) |
| 22 | var response utils.JsonResponse | 24 | var response utils.JsonResponse |
| 23 | if err != nil { | 25 | if err != nil { |
| @@ -6,7 +6,7 @@ import ( | @@ -6,7 +6,7 @@ import ( | ||
| 6 | ) | 6 | ) |
| 7 | 7 | ||
| 8 | func init() { | 8 | func init() { |
| 9 | - beego.Router("/notifications/read", &controllers.NotificationController{}, "Post:ReadSentNotification") | 9 | + beego.Router("/notifications/:sentNotificationId/read", &controllers.NotificationController{}, "Post:ReadSentNotification") |
| 10 | beego.Router("/notifications/read-all", &controllers.NotificationController{}, "Post:ReadAllUnReadSentNotification") | 10 | beego.Router("/notifications/read-all", &controllers.NotificationController{}, "Post:ReadAllUnReadSentNotification") |
| 11 | beego.Router("/notifications/", &controllers.NotificationController{}, "Get:ListSentNotification") | 11 | beego.Router("/notifications/", &controllers.NotificationController{}, "Get:ListSentNotification") |
| 12 | } | 12 | } |
| 1 | package notification | 1 | package notification |
| 2 | 2 | ||
| 3 | import ( | 3 | import ( |
| 4 | + "fmt" | ||
| 4 | "github.com/gavv/httpexpect" | 5 | "github.com/gavv/httpexpect" |
| 5 | "github.com/go-pg/pg" | 6 | "github.com/go-pg/pg" |
| 6 | . "github.com/onsi/ginkgo" | 7 | . "github.com/onsi/ginkgo" |
| @@ -8,6 +9,7 @@ import ( | @@ -8,6 +9,7 @@ import ( | ||
| 8 | "gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/domain" | 9 | "gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/domain" |
| 9 | pG "gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/infrastructure/pg" | 10 | pG "gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/infrastructure/pg" |
| 10 | "net/http" | 11 | "net/http" |
| 12 | + "strconv" | ||
| 11 | "time" | 13 | "time" |
| 12 | ) | 14 | ) |
| 13 | 15 | ||
| @@ -33,9 +35,8 @@ var _ = Describe("读取发送出的通知", func() { | @@ -33,9 +35,8 @@ var _ = Describe("读取发送出的通知", func() { | ||
| 33 | It("读取成功", func() { | 35 | It("读取成功", func() { |
| 34 | httpExpect := httpexpect.New(GinkgoT(), server.URL) | 36 | httpExpect := httpexpect.New(GinkgoT(), server.URL) |
| 35 | body := map[string]interface{}{ | 37 | body := map[string]interface{}{ |
| 36 | - "sentNotificationId": sentNotificationId, | ||
| 37 | } | 38 | } |
| 38 | - httpExpect.POST("/notifications/read"). | 39 | + httpExpect.POST(fmt.Sprintf("/notifications/%s/read", strconv.FormatInt(sentNotificationId, 10))). |
| 39 | WithJSON(body). | 40 | WithJSON(body). |
| 40 | Expect(). | 41 | Expect(). |
| 41 | Status(http.StatusOK). | 42 | Status(http.StatusOK). |
-
请 注册 或 登录 后发表评论