ReviewBoard使用
逻辑图:
一、首页
1.UI
1)控制窗口是否能被放大缩小
- resize // StoryBoard设置
- [window setStyleMask:[window styleMask] | NSResizableWindowMask]; // 代码设置
- [window setStyleMask:[window styleMask] & ~NSResizableWindowMask]; // 代码设置
2)NSButton
- textColor:NSMutableAttributedString // 更改字体颜色
- mouseEntered/mouseExited:NSTrackingArea // 鼠标移入移出
- NSButtonCell:重绘NSButton
- target/action:作为属性,不支持addTarget:action
3)NSTextView
- NSLabel:关闭编辑功能,取消边框,禁止选中的NSTextView
- focusRingType:取消选中边框 NSFocusRingTypeNone;
- stringValue:text内容
4)NSWindowController
2.API
登录:
二、创建合并请求页
1.UI
NSTableViewDelegate
- (NSInteger)numberOfRowsInTableView: // cell 行数
- tableView: viewForTableColumn: row: // 重载cell
- (void)tableViewSelectionDidChange: // 单击cell
2.API
获取工程列表:
GET http://xxx/api/v3/projects/owned?private_token=xxx&per_page=100
获取工程分支:
GET http://xxx/api/v3/projects/22/repository/branches?private_token=xxx
创建合并请求:
POST http://xxx/api/v3
Haeder : “PRIVATE-TOKEN” : “xxx”
Body : “source_branch=xxx&target_branch=xxx&target_project_id=xxx&title=xxx”
添加到数据库:
三、review页
1.UI
双击打开gitlab
- tableview setDoubleAction:// tableview添加双击事件
- [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:url]];// 打开网页
2.API
获取请求列表:
获取合并状态:
GET http://xxx/api/v3/projects/%d/merge_requests/%ld?private_token=xxx
%d:主工程id
%ld:mergerequest_id
点击通过删除请求记录:
某个mergerequest的记录列表:
DELETE http://xxx/mergerequest/getRecordsWithId.php?mergerequest_id=%ld
合并代码:
PUT http://xxx/api/v3/projects/%d/merge_requests/%ld/merge
Haeder : “PRIVATE-TOKEN” : “xxx”
%d:主工程id
%ld:mergerequest_id
点击不通过删除所有相关请求记录:
DELETE http://xxx/mergerequest/deleteRecordsWithMergeRequestId.php?mergerequest_id=%ld
发送邮件:
GET http://xxx/mergerequest/sendMail.php?mailto=xxx@lvmama.com&subject=xxx&content=xxx