Commit de92dc3f authored by 汪洋's avatar 汪洋

调整优化

parent 0556608d
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
D30D4AF0224CC3FF004CE936 /* Jira.swift in Sources */ = {isa = PBXBuildFile; fileRef = D30D4AEF224CC3FF004CE936 /* Jira.swift */; };
D30D4AF2224CCDE0004CE936 /* File in Resources */ = {isa = PBXBuildFile; fileRef = D30D4AF1224CCDE0004CE936 /* File */; };
D35CADA92642EF611E6ABE62 /* Pods_AutoJira.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6D013D83D9CA164C1F113E5D /* Pods_AutoJira.framework */; }; D35CADA92642EF611E6ABE62 /* Pods_AutoJira.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6D013D83D9CA164C1F113E5D /* Pods_AutoJira.framework */; };
D3E595DF22240DCC004DCC62 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3E595DE22240DCC004DCC62 /* AppDelegate.swift */; }; D3E595DF22240DCC004DCC62 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3E595DE22240DCC004DCC62 /* AppDelegate.swift */; };
D3E595E122240DCC004DCC62 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3E595E022240DCC004DCC62 /* ViewController.swift */; }; D3E595E122240DCC004DCC62 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3E595E022240DCC004DCC62 /* ViewController.swift */; };
...@@ -33,6 +35,8 @@ ...@@ -33,6 +35,8 @@
6D013D83D9CA164C1F113E5D /* Pods_AutoJira.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_AutoJira.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 6D013D83D9CA164C1F113E5D /* Pods_AutoJira.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_AutoJira.framework; sourceTree = BUILT_PRODUCTS_DIR; };
8D92517B7E535BFBB153A49B /* Pods-AutoJira.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AutoJira.release.xcconfig"; path = "Target Support Files/Pods-AutoJira/Pods-AutoJira.release.xcconfig"; sourceTree = "<group>"; }; 8D92517B7E535BFBB153A49B /* Pods-AutoJira.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AutoJira.release.xcconfig"; path = "Target Support Files/Pods-AutoJira/Pods-AutoJira.release.xcconfig"; sourceTree = "<group>"; };
ACBE7590179B597A40CC91EE /* Pods-AutoJira.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AutoJira.debug.xcconfig"; path = "Target Support Files/Pods-AutoJira/Pods-AutoJira.debug.xcconfig"; sourceTree = "<group>"; }; ACBE7590179B597A40CC91EE /* Pods-AutoJira.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AutoJira.debug.xcconfig"; path = "Target Support Files/Pods-AutoJira/Pods-AutoJira.debug.xcconfig"; sourceTree = "<group>"; };
D30D4AEF224CC3FF004CE936 /* Jira.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Jira.swift; sourceTree = "<group>"; };
D30D4AF1224CCDE0004CE936 /* File */ = {isa = PBXFileReference; lastKnownFileType = text; path = File; sourceTree = "<group>"; };
D3E595DB22240DCC004DCC62 /* AutoJira.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AutoJira.app; sourceTree = BUILT_PRODUCTS_DIR; }; D3E595DB22240DCC004DCC62 /* AutoJira.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AutoJira.app; sourceTree = BUILT_PRODUCTS_DIR; };
D3E595DE22240DCC004DCC62 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; D3E595DE22240DCC004DCC62 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
D3E595E022240DCC004DCC62 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; }; D3E595E022240DCC004DCC62 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
...@@ -105,6 +109,7 @@ ...@@ -105,6 +109,7 @@
D3E595EE22252765004DCC62 /* Page.swift */, D3E595EE22252765004DCC62 /* Page.swift */,
D3E595F42226AEC7004DCC62 /* Story.swift */, D3E595F42226AEC7004DCC62 /* Story.swift */,
D3E595F22226AE50004DCC62 /* RequestUtils.swift */, D3E595F22226AE50004DCC62 /* RequestUtils.swift */,
D30D4AEF224CC3FF004CE936 /* Jira.swift */,
D3E5960C222E2D1D004DCC62 /* Login.swift */, D3E5960C222E2D1D004DCC62 /* Login.swift */,
D3E595E222240DCF004DCC62 /* Assets.xcassets */, D3E595E222240DCF004DCC62 /* Assets.xcassets */,
D3E595E422240DCF004DCC62 /* Main.storyboard */, D3E595E422240DCF004DCC62 /* Main.storyboard */,
...@@ -127,6 +132,7 @@ ...@@ -127,6 +132,7 @@
D3E59610222FBDDD004DCC62 /* 修改Issue.md */, D3E59610222FBDDD004DCC62 /* 修改Issue.md */,
D3E596122233D22D004DCC62 /* 获取迭代列表.md */, D3E596122233D22D004DCC62 /* 获取迭代列表.md */,
D3E5961422366176004DCC62 /* 创建subtask获取信息.md */, D3E5961422366176004DCC62 /* 创建subtask获取信息.md */,
D30D4AF1224CCDE0004CE936 /* File */,
); );
path = "代码阅读"; path = "代码阅读";
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -203,6 +209,7 @@ ...@@ -203,6 +209,7 @@
D3E596012227B5A2004DCC62 /* XPath备忘.md in Resources */, D3E596012227B5A2004DCC62 /* XPath备忘.md in Resources */,
D3E5960F222FBDBC004DCC62 /* 获取EditIssue.md in Resources */, D3E5960F222FBDBC004DCC62 /* 获取EditIssue.md in Resources */,
D3E596052227B628004DCC62 /* 关联story.md in Resources */, D3E596052227B628004DCC62 /* 关联story.md in Resources */,
D30D4AF2224CCDE0004CE936 /* File in Resources */,
D3E5960B222E1E60004DCC62 /* 登录Login.md in Resources */, D3E5960B222E1E60004DCC62 /* 登录Login.md in Resources */,
D3E595FE2227B57D004DCC62 /* 创建subtask.md in Resources */, D3E595FE2227B57D004DCC62 /* 创建subtask.md in Resources */,
D3E596132233D22D004DCC62 /* 获取迭代列表.md in Resources */, D3E596132233D22D004DCC62 /* 获取迭代列表.md in Resources */,
...@@ -278,6 +285,7 @@ ...@@ -278,6 +285,7 @@
D3E5960D222E2D1D004DCC62 /* Login.swift in Sources */, D3E5960D222E2D1D004DCC62 /* Login.swift in Sources */,
D3E596092227B6F9004DCC62 /* RepeatdWork.swift in Sources */, D3E596092227B6F9004DCC62 /* RepeatdWork.swift in Sources */,
D3E595E122240DCC004DCC62 /* ViewController.swift in Sources */, D3E595E122240DCC004DCC62 /* ViewController.swift in Sources */,
D30D4AF0224CC3FF004CE936 /* Jira.swift in Sources */,
D3E595F52226AEC7004DCC62 /* Story.swift in Sources */, D3E595F52226AEC7004DCC62 /* Story.swift in Sources */,
D3E595DF22240DCC004DCC62 /* AppDelegate.swift in Sources */, D3E595DF22240DCC004DCC62 /* AppDelegate.swift in Sources */,
D3E595EF22252765004DCC62 /* Page.swift in Sources */, D3E595EF22252765004DCC62 /* Page.swift in Sources */,
......
//
// Jira.swift
// AutoJira
//
// Created by wangyang on 2019/3/28.
// Copyright © 2019 wangyang. All rights reserved.
//
import Cocoa
class Jira: NSObject {
var jiraProjectId: String = ""
var sprints: [Sprint] = []
var currentSprint: Sprint?
var subtask_id: String = ""
convenience init(jiraProjectId: String, sprints: [Sprint]) {
self.init()
self.jiraProjectId = jiraProjectId
self.sprints = sprints
// like sub task 10302
// gengmei sub task 10003
if jiraProjectId == "10108" {
// 更美
subtask_id = "10003"
} else {
// like
subtask_id = "10302"
}
}
}
...@@ -11,7 +11,7 @@ import Kanna ...@@ -11,7 +11,7 @@ import Kanna
import ReactiveCocoa import ReactiveCocoa
struct RepeatedWork { struct RepeatedWork {
static var jira: JIRA? static var jira: Jira?
// url是“开发与测试资源安排”中的迭代文件 // url是“开发与测试资源安排”中的迭代文件
static func fuckit(on sprintUrl: String) { static func fuckit(on sprintUrl: String) {
...@@ -40,6 +40,7 @@ struct RepeatedWork { ...@@ -40,6 +40,7 @@ struct RepeatedWork {
// 期望在这儿只得到主需求的列表 // 期望在这儿只得到主需求的列表
// 但是doc.xpath("//td[@data-content-id]")仍然得到了所有的 // 但是doc.xpath("//td[@data-content-id]")仍然得到了所有的
//
let obj = doc.xpath("//*[@id=\"main-content\"]/div[2]/table/tbody//td[@data-content-id]") let obj = doc.xpath("//*[@id=\"main-content\"]/div[2]/table/tbody//td[@data-content-id]")
if obj.count == 0 { if obj.count == 0 {
Log.append("没有需要列表\nhtml") Log.append("没有需要列表\nhtml")
......
...@@ -66,7 +66,7 @@ class Story: NSObject { ...@@ -66,7 +66,7 @@ class Story: NSObject {
var request = URLRequest(url: url) var request = URLRequest(url: url)
request.httpMethod = "POST" request.httpMethod = "POST"
request.setValue("application/json", forHTTPHeaderField: "Content-Type") request.setValue("application/json", forHTTPHeaderField: "Content-Type")
let bodyString = "{\"pageId\":\"\(pageId)\",\"selectedText\":\"项目背景\",\"index\":0,\"numMatches\":2,\"lastFetchTime\":\(pageLastFetchTime),\"xmlModification\":\"<ac:macro ac:name='jira'><ac:parameter ac:name='showSummary'>false</ac:parameter><ac:parameter ac:name='server'>JIRA</ac:parameter><ac:parameter ac:name='serverId'>54ed5447-b029-3ef0-b638-681b4647313b</ac:parameter><ac:parameter ac:name='key'>\(storyKey)</ac:parameter></ac:macro>\"}" let bodyString = "{\"pageId\":\"\(pageId)\",\"selectedText\":\"项目背景\",\"index\":0,\"numMatches\":1,\"lastFetchTime\":\(pageLastFetchTime),\"xmlModification\":\"<ac:macro ac:name='jira'><ac:parameter ac:name='showSummary'>false</ac:parameter><ac:parameter ac:name='server'>JIRA</ac:parameter><ac:parameter ac:name='serverId'>54ed5447-b029-3ef0-b638-681b4647313b</ac:parameter><ac:parameter ac:name='key'>\(storyKey)</ac:parameter></ac:macro>\"}"
let data = bodyString.data(using: .utf8) let data = bodyString.data(using: .utf8)
request.httpBody = data request.httpBody = data
......
...@@ -36,35 +36,13 @@ struct Sprint { ...@@ -36,35 +36,13 @@ struct Sprint {
} }
} }
class JIRA: NSObject {
var jiraProjectId: String = ""
var sprints: [Sprint] = []
var currentSprint: Sprint?
var subtask_id: String = ""
convenience init(jiraProjectId: String, sprints: [Sprint]) {
self.init()
self.jiraProjectId = jiraProjectId
self.sprints = sprints
// like sub task 10302
// gengmei sub task 10003
if jiraProjectId == "10108" {
// 更美
subtask_id = "10003"
} else {
// like
subtask_id = "10302"
}
}
}
class ViewController: NSViewController { class ViewController: NSViewController {
@IBOutlet var logTextView: NSTextView! @IBOutlet var logTextView: NSTextView!
@IBOutlet weak var urlTextField: NSTextField! @IBOutlet weak var urlTextField: NSTextField!
@IBOutlet weak var versionPopup: NSPopUpButton! @IBOutlet weak var versionPopup: NSPopUpButton!
@IBOutlet weak var segment: NSSegmentedControl! @IBOutlet weak var segment: NSSegmentedControl!
var jiraProjects: [Int: JIRA] = [:] var jiraProjects: [Int: Jira] = [:]
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
...@@ -115,8 +93,8 @@ class ViewController: NSViewController { ...@@ -115,8 +93,8 @@ class ViewController: NSViewController {
// project AL: 10500 // project AL: 10500
// project USER: 10108 // project USER: 10108
jiraProjects = [0: JIRA(jiraProjectId: "10108", sprints: gengmeiSprints), jiraProjects = [0: Jira(jiraProjectId: "10108", sprints: gengmeiSprints),
1: JIRA(jiraProjectId: "10500", sprints: likeSprints)] 1: Jira(jiraProjectId: "10500", sprints: likeSprints)]
} }
@IBAction func switchProject(_ sender: NSSegmentedControl) { @IBAction func switchProject(_ sender: NSSegmentedControl) {
......
...@@ -7,10 +7,10 @@ Accept-Encoding: gzip, deflate ...@@ -7,10 +7,10 @@ Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Origin: http://jira.wanmeizhensuo.com Origin: http://jira.wanmeizhensuo.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.3 Safari/605.1.15 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.3 Safari/605.1.15
Referer: http://jira.wanmeizhensuo.com/browse/AL-1581 Referer: http://jira.wanmeizhensuo.com/browse/AL-1583
Content-Length: 3773 Content-Length: 78
Connection: keep-alive Connection: keep-alive
Cookie: AJS.conglomerate.cookie="|hipchat.inapp.links.first.clicked.wangyang=false"; JSESSIONID=5209D0B3CD611AA9C5B17E20E50F634F; atlassian.xsrf.token=BR38-RKGV-NWEL-Y2GE|5c48c0d3b1357d74c2092adf4fef6348219e69ac|lin; jira.editor.user.mode=wysiwyg Cookie: AJS.conglomerate.cookie="|hipchat.inapp.links.first.clicked.wangyang=false"; JSESSIONID=5209D0B3CD611AA9C5B17E20E50F634F; atlassian.xsrf.token=BR38-RKGV-NWEL-Y2GE|5c48c0d3b1357d74c2092adf4fef6348219e69ac|lin; jira.editor.user.mode=wysiwyg
X-SITEMESH-OFF: true X-SITEMESH-OFF: true
issueKey=AL-1581&decorator=none&prefetch=false&shouldUpdateCurrentProject=true&lastReadTime=1553765176157&fields=summary%3A6c884f04be832d4cbd2e7d3c39ca289f&fields=issuetype%3Aa215617462d1bf8f8d0a45163022179f&fields=reporter%3A77ab88b16f3b4e2a4b26421bf2980d67&fields=components%3Afce22290886deb966894b65c668dcc85&fields=description%3A0526f0143f9d349270db5a959d8e4c5c&fields=fixVersions%3A7ca518a0b4df3ec9a09a6e00d3aacbe1&fields=priority%3A16dcd0b75c73378d53145e484c14ad81&fields=labels%3Aa58f6b8d944d662e0dc711e4a89ed05c&fields=attachment%3A705f20adbf8aee088364611f599872b4&fields=issuelinks%3A25f1db0f4623070dd9880d26546602cf&fields=assignee%3Ae2518b000aa7598c3d237b1bfe9f3925&fields=customfield_10006%3A1fbfda0c3e4311ff101beec15d98b730&fields=customfield_10005%3A8299bbb96a41949316fb160ce06d5bbd&fields=comment%3A5763ed3b5f04ae509db53bdb064bdd63&issue=summary%3A08f8e0260c64418510cefb2b06eee5cd&links=edit-issue%3A0e1878eeab01ca240bf14722f7cd88c1&links=comment-issue%3A283881cca0a33d8abad9ea41abce5219&links=assign-issue%3A00442fa2fb4dfdb899ac5bba3dff49e2&links=log-work%3Aa5562e64e5b74a0a3f1941fbc181166f&links=greenhopper-rapidboard-operation%3A356a1da025d3ef46f24f4d6dae559457&links=greenhopper-rank-top-operation%3A5f8164511b7e0a72dadaa67975b981a5&links=greenhopper-rank-bottom-operation%3A853fa3184b47e02a7e45c89335c93c1d&links=attach-file%3A986874e54fff1a881c68121844513fff&links=attach-screenshot-html5%3A1eccf62bd2fb718d24d528d9a7e0ab55&links=toggle-vote-issue%3A791a2f7df829ba528328890da4c7b7c1&links=view-voters%3A945004cbf7ea11a7079e4cd189440cf8&links=toggle-watch-issue%3A93b6d34a48d7dc11aff8193c150bbd41&links=manage-watchers%3Af64a67da4b421fd5aeaa6c43b6a69c8f&links=subtask-to-issue%3A359bfaa8180beb33b068bb0dd7ba0bf0&links=move-issue%3A112b14e652d08e221453443cf22df4d6&links=link-issue%3A95ca31e72da70217d89f6075d32a27e7&links=clone-issue%3A88bf6605adf4baaeb29534e3e51814c1&links=edit-labels%3Ad5158bedab0d652302f76a69bf9d690e&links=create-test-session%3A5b990700d7791046a71ead7a1924f640&links=delete-issue%3A175e74e642580209a28686937563a075&links=action_id_81%3Aed340def0ee7315d7b9dfbe3b57a7793&links=com.atlassian.jira.jira-project-config-plugin%3Aadd-custom-field%3A3f1bb5120b54abc1a56211c6e11252b2&links=jira-operations-whereismycf-trigger%3Af47e82ce531d991448d9c8aa07d74eec&links=jira-operations-permissionhelper-trigger%3A71fcd3646705f3c813ccdfe79b0b30e2&links=jira-operations-notificationhelper-trigger%3Ae4d2a4947c3e15665f794091b106ddfe&links=jira-share-trigger%3A0c5d26a364e768fa1ec9608107213ffd&links=jira.issueviews%3Aissue-xml%3A53fa8027499b6753974e49a183d4459a&links=jira.issueviews%3Aissue-word%3Add993c30504272f40ff66e5d6326af76&links=jira.issueviews%3Aissue-html%3A3155b4d18b11f4bf46611bc85c79acf5&panels=com.atlassian.jira.jira-view-issue-plugin%3Adetails-module%3Abc4698edfc4f96214dfee5190d827570&panels=com.atlassian.jira.jira-view-issue-plugin%3Adescriptionmodule%3A3016b67337271288dc9d4192c96c6c6a&panels=com.atlassian.jira.plugins.jira-dnd-attachment-plugin%3Adnd-metadata%3A492caec79f798aaeafe7b53228146bb2&panels=com.atlassian.jira.jira-view-issue-plugin%3Aattachmentmodule%3A9d207289643ad4a6267964e8c9030608&panels=com.atlassian.jira.jira-view-issue-plugin%3Aactivitymodule%3Ac200cdd6676240d980657ac2da031844&panels=com.atlassian.jira.plugin.system.comment-panel%3Aaddcommentmodule%3Acb547c13b2dd5ec5b256df310a4a71f2&panels=com.atlassian.jira.jira-view-issue-plugin%3Apeoplemodule%3Aedbda6a5b62d4ecf158b09b0055b6868&panels=com.atlassian.jira.jira-view-issue-plugin%3Adatesmodule%3A06746413449adddab9219c86ebc38fc1&panels=com.pyxis.greenhopper.jira%3Agreenhopper-agile-issue-web-panel%3A53f811d827e419528a1a9d55f16f2012&panels=com.atlassian.jira.plugin.ext.bamboo%3Abamboo-deployment-projects-right%3A4b7ea9261210d9c77b58428ecd737081 issueKey=AL-1583&decorator=none&prefetch=false&shouldUpdateCurrentProject=true
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment