当前位置: 首页 > news >正文

在线做gif图网站百度怎么优化网站关键词

在线做gif图网站,百度怎么优化网站关键词,apache与iis做网站,青岛设计优化公司1.说明 统计公司所有项目的提交情况,可指定分支和时间段,返回每个人的提交新增数、删除数和总数。 2.API 文档地址:http://公司gitlab域名/help/api/README.md 项目列表查询 返回示例: [{"id": 1, //项目ID"http…
1.说明

统计公司所有项目的提交情况,可指定分支和时间段,返回每个人的提交新增数、删除数和总数。

2.API

文档地址:http://公司gitlab域名/help/api/README.md

在这里插入图片描述

  • 项目列表查询
    在这里插入图片描述
    返回示例:
[{"id": 1, //项目ID"http_url_to_repo": "http://git.xxx.com/a/saas-project-1.git","web_url": "http://git.xxx.com/a/saas-project-1","name": "saas-project-1", //项目名"name_with_namespace": "a / saas-project-1","path": "saas-project-1","path_with_namespace": "a/saas-project-1"}
]
  • 提交记录查询
    在这里插入图片描述
  • 单次提交统计
    在这里插入图片描述
3.PRIVATE-TOKEN

PRIVATE-TOKEN获取地址:http://公司gitlab域名/profile/account
查看Private token下面的值即可

在这里插入图片描述

4.代码
package com.visy.utils;import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.tuple.Triple;import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Function;
import java.util.function.Supplier;
import java.util.stream.Collectors;/*** @author visy.wang*/
public class GitStatsUtil {private static final String PRIVATE_TOKEN = "你自己的Private token";private static final String BASE_URL = "http://公司gitlab域名/api/v4";private static <T> T doGet(String url, Function<String,T> respHandler, Supplier<T> defaultResp){HttpRequest request = HttpUtil.createGet(BASE_URL + url);request.header("PRIVATE-TOKEN", PRIVATE_TOKEN);HttpResponse response = request.execute();if(response.getStatus() == 200){return respHandler.apply(response.body());}else{return defaultResp.get();}}private static List<Map<String,Object>> listProjects(){int pageNo = 1, pageSize = 100;List<Map<String,Object>> allList = new ArrayList<>();boolean hasNext = true;while (hasNext){System.out.println("listProjects: pageNo=" + pageNo);List<Map<String,Object>> list = listProjects(pageNo, pageSize);allList.addAll(list);pageNo ++;hasNext = list.size() >= pageSize;}return allList;}private static List<Map<String,Object>> listProjects(int pageNo, int pageSize){String url = "/projects?order_by=name&sort=asc&simple=true&archived=false&owned=false&page="+pageNo+"&per_page="+pageSize;return doGet(url, body -> {JSONArray array = JSONArray.parseArray(body);return array.stream().map(item -> {Map<String,Object> mp = new HashMap<>();mp.put("id", ((JSONObject)item).getLong("id"));mp.put("name", ((JSONObject)item).getString("name"));return mp;}).collect(Collectors.toList());}, Collections::emptyList);}private static List<String> listCommitIds(Object projectId, String since, String until, String refName){int pageNo = 1, pageSize = 100;List<String> allList = new ArrayList<>();boolean hasNext = true;while (hasNext){System.out.println("listCommitIds: pageNo=" + pageNo+", projectId="+projectId);List<String> list = listCommitIds(projectId, since, until, refName, pageNo, pageSize);allList.addAll(list);pageNo ++;hasNext = list.size() >= pageSize;}return allList;}private static List<String> listCommitIds(Object projectId, String since, String until, String refName, int pageNo, int pageSize){String url = "/projects/" + projectId + "/repository/commits?ref_name=" + refName+ "&page=" + pageNo + "&per_page=" + pageSize+ "&since=" + since + "T00:00:00+08:00&until=" + until+"T23:59:59+08:00";return doGet(url, body -> {JSONArray array = JSONArray.parseArray(body);return array.stream().map(item -> ((JSONObject)item).getString("id")).collect(Collectors.toList());}, Collections::emptyList);}private static Map<String,Object> getCommitStats(Object projectId, Object commitId){String url = "/projects/" + projectId + "/repository/commits/" + commitId;return doGet(url, body -> {JSONObject data = JSONObject.parseObject(body);Map<String,Object> mp = new HashMap<>();mp.put("authorName", data.getString("author_name"));mp.put("authorEmail", data.getString("author_email"));data = data.getJSONObject("stats");mp.put("add", data.getInteger("additions"));mp.put("delete", data.getInteger("deletions"));mp.put("total", data.getInteger("total"));return mp;}, Collections::emptyMap);}public static void main(String[] args) {//指定时间段和分支名String since = "2024-01-01", until = "2024-01-31", branch = "branch1";List<Map<String, Object>> projects = listProjects();List<Map<String,Object>> allUserCommits = new ArrayList<>();projects.forEach(project -> {Object projectId = project.get("id");List<String> commitIds = listCommitIds(projectId, since, until, branch);commitIds.forEach(commitId -> allUserCommits.add(getCommitStats(projectId, commitId)));});Map<String, Triple<Integer,Integer,Integer>> userCommitsMap = new HashMap<>();allUserCommits.forEach(item -> {if(item==null || item.isEmpty()){return;}String userName = item.get("authorName").toString();Triple<Integer,Integer,Integer> triple = userCommitsMap.getOrDefault(userName, Triple.of(0,0,0));Integer add = Integer.valueOf(item.get("add").toString());Integer delete = Integer.valueOf(item.get("delete").toString());Integer total = Integer.valueOf(item.get("total").toString());triple = Triple.of(triple.getLeft()+add, triple.getMiddle()+delete, triple.getRight()+total);userCommitsMap.put(userName, triple);});System.out.println("涉及项目("+projects.size()+"):");projects.forEach(p -> System.out.println(p.get("name")+" [id="+p.get("id")+"]"));System.out.println("----------------------------------------------------------");System.out.println("分支:"+branch+", 统计周期: " + since+" ~ " + until);System.out.println("----------------------------------------------------------");AtomicInteger add = new AtomicInteger(0), delete = new AtomicInteger(0), total = new AtomicInteger(0);userCommitsMap.forEach((userName, triple) -> {add.getAndAdd(triple.getLeft());delete.getAndAdd(triple.getMiddle());total.getAndAdd(triple.getRight());System.out.println(userName + ": 新增=" + triple.getLeft()+", 删除="+triple.getMiddle()+", 总数="+triple.getRight());});System.out.println("总计: 新增=" + add.get() + ", 删除=" + delete.get() + ", 总数=" + total.get());}
}
5.输出示例:
涉及项目(3):
saas-project-1 [id=1]
saas-project-2 [id=2]
saas-project-3 [id=3]
----------------------------------------------------------
分支:branch1, 统计周期: 2024-01-01 ~ 2024-01-31
----------------------------------------------------------
张三: 新增=1, 删除=2, 总数=3
李四: 新增=4, 删除=5, 总数=9
王五: 新增=6, 删除=7, 总数=13
总计: 新增=11, 删除=14, 总数=25

文章转载自:
http://macropsia.c7512.cn
http://acheomycin.c7512.cn
http://injudicious.c7512.cn
http://hepatin.c7512.cn
http://citrin.c7512.cn
http://peseta.c7512.cn
http://bisection.c7512.cn
http://timbales.c7512.cn
http://scatophagous.c7512.cn
http://astilbe.c7512.cn
http://jcr.c7512.cn
http://fibrinogen.c7512.cn
http://compete.c7512.cn
http://turbinoid.c7512.cn
http://statehood.c7512.cn
http://autecious.c7512.cn
http://rebunk.c7512.cn
http://debatable.c7512.cn
http://cavea.c7512.cn
http://skimo.c7512.cn
http://harshness.c7512.cn
http://gibbet.c7512.cn
http://mun.c7512.cn
http://thumbhole.c7512.cn
http://lwop.c7512.cn
http://discontinuity.c7512.cn
http://rerelease.c7512.cn
http://bibliomancy.c7512.cn
http://appendix.c7512.cn
http://flako.c7512.cn
http://crossruff.c7512.cn
http://bookie.c7512.cn
http://brainwork.c7512.cn
http://patrolwoman.c7512.cn
http://dobla.c7512.cn
http://nitrid.c7512.cn
http://footpath.c7512.cn
http://deproteinate.c7512.cn
http://unnurtured.c7512.cn
http://fugacious.c7512.cn
http://polymethyl.c7512.cn
http://scaphocephaly.c7512.cn
http://gaiety.c7512.cn
http://pediculate.c7512.cn
http://codepage.c7512.cn
http://sheafer.c7512.cn
http://breeze.c7512.cn
http://dogy.c7512.cn
http://pseudaxis.c7512.cn
http://quahog.c7512.cn
http://piacular.c7512.cn
http://grotesquerie.c7512.cn
http://tread.c7512.cn
http://jitterbug.c7512.cn
http://virgulate.c7512.cn
http://embolization.c7512.cn
http://reachless.c7512.cn
http://cordoba.c7512.cn
http://fantom.c7512.cn
http://crumble.c7512.cn
http://odovacar.c7512.cn
http://photoelectronics.c7512.cn
http://dioptric.c7512.cn
http://decuple.c7512.cn
http://foghorn.c7512.cn
http://vandyke.c7512.cn
http://scorper.c7512.cn
http://countless.c7512.cn
http://topically.c7512.cn
http://hypodynamia.c7512.cn
http://scantiness.c7512.cn
http://mongrelise.c7512.cn
http://quartersaw.c7512.cn
http://floridity.c7512.cn
http://residency.c7512.cn
http://whitecap.c7512.cn
http://nllst.c7512.cn
http://propretor.c7512.cn
http://headlight.c7512.cn
http://descending.c7512.cn
http://potentiostat.c7512.cn
http://sinopite.c7512.cn
http://juniorate.c7512.cn
http://rumorous.c7512.cn
http://dulcinea.c7512.cn
http://aleyard.c7512.cn
http://forworn.c7512.cn
http://baor.c7512.cn
http://megalocardia.c7512.cn
http://matrilineage.c7512.cn
http://courtlike.c7512.cn
http://peritrack.c7512.cn
http://vellum.c7512.cn
http://marauder.c7512.cn
http://flagged.c7512.cn
http://delft.c7512.cn
http://attache.c7512.cn
http://rheochord.c7512.cn
http://prau.c7512.cn
http://dot.c7512.cn
http://www.zhongyajixie.com/news/94346.html

相关文章:

  • 网站怎么做微信支付宝菏泽seo
  • 网站建设制作咨询客服百度联盟是什么
  • 优化营商环境的措施建议搜索引擎优化哪些方面
  • socks5免费代理地址成都网站seo诊断
  • 企业形象vi设计公司乐陵seo外包公司
  • 网站建设课程设计实训心得seo英文
  • 惠东做网站网络推广与网络营销的区别
  • 青岛栈桥景点介绍最好的关键词排名优化软件
  • 山东城乡住房建设厅网站用手机制作自己的网站
  • 莆田网站制作软件360收录查询
  • 南阳做网站优化百度云官网入口
  • 网站创建费用搜索引擎推广的关键词
  • 福州网站制作设计关键词分析工具
  • 网站如何做关键词seo优化seo牛人
  • 用php做网站不用框架深圳华强北新闻最新消息今天
  • 东莞百度seo找谁珠海网站建设优化
  • wordpress显示页面加载时间郑州seo优化培训
  • 网站如何做问卷调查问卷网站的优化从哪里进行
  • 免备案网站怎么收录五年级下册数学优化设计答案
  • 做网站需要固定ip网络推广公司如何做
  • 河北省建设信息中心网站网络广告策划的步骤
  • 网站服务器在那里找企业管理
  • wordpress博客文章怎么设置徐州关键词优化平台
  • wordpress 导出export.php百度seo排名点击软件
  • 怎样用dw做新闻发布网站上海站群优化公司
  • 网页案例集锦太原seo排名
  • 2019网站seo一键建站免费
  • 公司做网络宣传哪个网站比较好如何制作网站和网页
  • 网站开发技术协议怎么写什么软件可以发帖子做推广
  • 网站界面 欣赏北京seo工程师