change synchronization_service

This commit is contained in:
chenjing 2022-07-13 10:50:06 +08:00
parent d957955789
commit a82cf528a6
1 changed files with 2 additions and 2 deletions

View File

@ -18,7 +18,7 @@ class Users::SynchronizationService
def sync_to_smart_doaction def sync_to_smart_doaction
uri = URI("http://smart.doaction.tech/smartApi/callback/mulan/project/favorite") uri = URI("http://smart.doaction.tech/smartApi/callback/mulan/project/favorite")
http = Net::HTTP.new(uri.host, uri.port) http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.path, initheader = {'Content-Type' => 'text/plain;charset=utf-8'}) req = Net::HTTP::Post.new(uri.path, initheader = {'Content-Type' => 'application/json; charset=utf-8'})
req.body = @data.to_json req.body = @data.to_json
res = http.request(req) res = http.request(req)
body = res.body body = res.body
@ -32,7 +32,7 @@ class Users::SynchronizationService
projectUrl:"https://code.mulanos.cn/#{@target.owner.login}/#{@target.name}", projectUrl:"https://code.mulanos.cn/#{@target.owner.login}/#{@target.name}",
projectTitle: @target.name, projectTitle: @target.name,
projectDesc: @target.description, projectDesc: @target.description,
operateTime: Time.now.to_i, operateTime: Time.now.to_i * 1000,
} }
end end