Open petrokramar opened 6 years ago
Import raw channels list from slack
add class RawChannel whith field private Map<String,Object> channelData;
add class SlackRepository which use restTemplate and ipmlement method List
add class ChannelsRepository
Use mongoTemplate
Collection name - raw_channels
implement method void saveRawChannels(List
add class SlackService which implement method List
add class ChannelsService which implement method void saveRawChannels(List
where rawChannels are received from SlackService.getRawChannels(). You need add pair key-value ("date" - current date) to the field channelData of each rawChannel before saving document to collection "raw_channels".
no changes
SlackChatService method saveRawChannels runs on schedule.
Document example:
{ "_id" : ObjectId("5a64ebe1d3a73015f8ed6189"), "_class" : "com.example.demo.RawChannel", "channel" : { "id" : "C703E6B51", "name" : "general", "is_channel" : true, "created" : 1504873648, "is_archived" : false, "is_general" : true, "unlinked" : 0, "creator" : "U707A97B6", "name_normalized" : "general", "is_shared" : false, "is_org_shared" : false, "is_member" : true, "is_private" : false, "is_mpim" : false, "members" : [ "U707A97B6", "U712G0NUE" ], "topic" : { "value" : "Company-wide announcements and work-based matters", "creator" : "U707A97B6", "last_set" : 1504873648 }, "purpose" : { "value" : "This channel is for workspace-wide communication and announcements. All members are in this channel.", "creator" : "U707A97B6", "last_set" : 1504873648 }, "previous_names" : [], "num_members" : 2, "date" : ISODate("2018-01-21T19:37:05.758Z") } }
, where "date" is date of loading channels list from slack
Import raw channels list from slack
add class RawChannel whith field private Map<String,Object> channelData;
add class SlackRepository which use restTemplate and ipmlement method List
add class ChannelsRepository
Use mongoTemplate
Collection name - raw_channels
implement method void saveRawChannels(List
add class SlackService which implement method List
add class ChannelsService which implement method void saveRawChannels(List
where rawChannels are received from SlackService.getRawChannels(). You need add pair key-value ("date" - current date) to the field channelData of each rawChannel before saving document to collection "raw_channels".
no changes
SlackChatService method saveRawChannels runs on schedule.
Document example:
{ "_id" : ObjectId("5a64ebe1d3a73015f8ed6189"), "_class" : "com.example.demo.RawChannel", "channel" : { "id" : "C703E6B51", "name" : "general", "is_channel" : true, "created" : 1504873648, "is_archived" : false, "is_general" : true, "unlinked" : 0, "creator" : "U707A97B6", "name_normalized" : "general", "is_shared" : false, "is_org_shared" : false, "is_member" : true, "is_private" : false, "is_mpim" : false, "members" : [ "U707A97B6", "U712G0NUE" ], "topic" : { "value" : "Company-wide announcements and work-based matters", "creator" : "U707A97B6", "last_set" : 1504873648 }, "purpose" : { "value" : "This channel is for workspace-wide communication and announcements. All members are in this channel.", "creator" : "U707A97B6", "last_set" : 1504873648 }, "previous_names" : [], "num_members" : 2 } }
I removed "data" from channel structure because we decided to store only last raw information about channel.
1) What is this feature/fix provided for?
Import raw channels list from slack
2) List the objects you want to add or change, use appropriate API annotations
3) Are there any special requirements or constraints?
4) What behavior do you expect? Any examples?
Document example:
{ "_id" : ObjectId("5a64ebe1d3a73015f8ed6189"), "_class" : "com.example.demo.RawChannel", "channel" : { "id" : "C703E6B51", "name" : "general", "is_channel" : true, "created" : 1504873648, "is_archived" : false, "is_general" : true, "unlinked" : 0, "creator" : "U707A97B6", "name_normalized" : "general", "is_shared" : false, "is_org_shared" : false, "is_member" : true, "is_private" : false, "is_mpim" : false, "members" : [ "U707A97B6", "U712G0NUE" ], "topic" : { "value" : "Company-wide announcements and work-based matters", "creator" : "U707A97B6", "last_set" : 1504873648 }, "purpose" : { "value" : "This channel is for workspace-wide communication and announcements. All members are in this channel.", "creator" : "U707A97B6", "last_set" : 1504873648 }, "previous_names" : [], "num_members" : 2, "date" : ISODate("2018-01-21T19:37:05.758Z") } }
, where "date" is date of loading channels list from slack